Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first

  • Loading branch information...
commit 17c65aded4a1f1d95c07fd65a901f590d1eee524 0 parents
@Raynos Raynos authored
3  .npmignore
@@ -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.
0  Makefile
No changes.
22 README.md
@@ -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
12 index.js
@@ -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
+}
31 package.json
@@ -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": {
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.