Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-bmfont-xml

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-bmfont-xml - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

lib/browser.js

21

package.json
{
"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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc