parse-bmfont-xml
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "parse-bmfont-xml", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "parses XML BMFont files into a JavaScript object", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"browser": "lib/browser.js", | ||
"license": "MIT", | ||
@@ -13,7 +14,17 @@ "author": { | ||
"dependencies": { | ||
"xml2js": "^0.4.5" | ||
"xhr": "^2.0.1", | ||
"xml-parse-from-string": "^1.0.0", | ||
"xml2js": "^0.4.5", | ||
"xtend": "^4.0.0" | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"brfs": "^1.4.0", | ||
"browserify": "^9.0.3", | ||
"faucet": "0.0.1", | ||
"testling": "^1.7.1" | ||
}, | ||
"scripts": { | ||
"test": "node test/test.js" | ||
"test-browser": "browserify test/test-browser.js -t brfs | testling | faucet", | ||
"test-node": "node test/test.js | faucet", | ||
"test": "npm run test-node && npm run test-browser" | ||
}, | ||
@@ -20,0 +31,0 @@ "keywords": [ |
@@ -22,2 +22,16 @@ # parse-bmfont-xml | ||
Also works in the browser, for example using XHR: | ||
```js | ||
var parse = require('parse-bmfont-xml') | ||
var xhr = require('xhr') | ||
xhr({ uri: 'fonts/NexaLight32.xml' }, function(err, res, body) { | ||
if (err) | ||
throw err | ||
var result = parse(body) | ||
console.log(result.info.face) | ||
}) | ||
``` | ||
The spec for the returned JSON object is [here](https://github.com/mattdesl/bmfont2json/wiki/JsonSpec). The input XML should match the spec with a `<font>` root element, see [test/Nexa Light-32.fnt](test/Nexa Light-32.fnt) for an example. | ||
@@ -56,4 +70,8 @@ | ||
If the data is malformed, an error will be thrown. | ||
The browser implementation relies on [xml-parse-from-string](https://github.com/Jam3/xml-parse-from-string), which may not work in environments without valid DOM APIs (like CocoonJS). | ||
## License | ||
MIT, see [LICENSE.md](http://github.com/mattdesl/parse-bmfont-xml/blob/master/LICENSE.md) for details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7491
5
125
76
4
4
+ Addedxhr@^2.0.1
+ Addedxml-parse-from-string@^1.0.0
+ Addedxtend@^4.0.0
+ Addeddom-walk@0.1.2(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedis-function@1.0.2(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedparse-headers@2.0.5(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedxhr@2.6.0(transitive)
+ Addedxml-parse-from-string@1.0.1(transitive)
+ Addedxtend@4.0.2(transitive)