Permalink
Browse files

first

  • Loading branch information...
0 parents commit 17c65aded4a1f1d95c07fd65a901f590d1eee524 @Raynos Raynos committed Aug 26, 2012
Showing with 87 additions and 0 deletions.
  1. +3 −0 .npmignore
  2. +19 −0 LICENCE
  3. 0 Makefile
  4. +22 −0 README.md
  5. +12 −0 index.js
  6. +31 −0 package.json
@@ -0,0 +1,3 @@
+node_modules
+*.log
+*.err
19 LICENCE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
No changes.
@@ -0,0 +1,22 @@
+# svg
+
+Create svg elements from a string
+
+## Example
+
+``` js
+var svg = require("svg")
+
+var text = "<rect fill='blue' height='50' width='50'>"
+var elem = svg(text)
+```
+
+## Installation
+
+`npm install svg`
+
+## Contributors
+
+ - Raynos
+
+## MIT Licenced
@@ -0,0 +1,12 @@
+module.exports = Element
+
+function Element(svgText) {
+ var parser = new DOMParser()
+ , xmlText = "<svg xmlns=\'http://www.w3.org/2000/svg\'>" +
+ svgText + "</svg>"
+ , docElem = parser.parseFromString(xmlText, "text/xml").documentElement
+
+ var node = docElem.firstChild
+ document.importNode(node, true)
+ return node
+}
@@ -0,0 +1,31 @@
+{
+ "name": "svg",
+ "version": "0.0.1",
+ "description": "Create svg elements from a string",
+ "keywords": [],
+ "author": "Raynos <raynos2@gmail.com>",
+ "repository": "git://github.com/Raynos/svg.git",
+ "main": "index",
+ "homepage": "https://github.com/Raynos/svg",
+ "contributors": [
+ {
+ "name": "Jake Verbaten"
+ }
+ ],
+ "bugs": {
+ "url": "https://github.com/Raynos/svg/issues",
+ "email": "raynos2@gmail.com"
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/Raynos/svg/raw/master/LICENSE"
+ }
+ ],
+ "scripts": {
+ }
+}

0 comments on commit 17c65ad

Please sign in to comment.