parser-xml:解析器缓存兼容的 XML 解析器

  • h8_706516
    了解作者
  • 5.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-24 22:12
    上传日期
解析器-xml 解析器缓存兼容的 XML 解析器。 安装 使用安装 npm i parser-xml --save 运行测试 npm test 用法 var parser = require ( 'parser-xml' ) ; 解析 parser . parse ( str , options , function ( err , res ) { if ( err ) { throw err ; } console . log ( res ) ; } ) ; 解析文件 parser . parseFile ( 'fixtures/a.xml' , function ( err , res ) { if ( err ) { throw err ; } console . log ( res ) ; } ) ; 应用程序接口 str {String|Object} :
parser-xml-master.zip
  • parser-xml-master
  • .jshintrc
    280B
  • .gitignore
    101B
  • package.json
    837B
  • index.js
    1.4KB
  • test.js
    827B
  • .verb.md
    809B
  • LICENSE-MIT
    1.1KB
  • README.md
    1.6KB
  • .gitattributes
    237B
  • fixtures
  • basic.xml
    529B
内容介绍
# parser-xml [![NPM version](https://badge.fury.io/js/parser-xml.svg)](http://badge.fury.io/js/parser-xml) > parser-cache compatible XML parser. ## Install ### Install with [npm](npmjs.org) ```bash npm i parser-xml --save ``` ## Run tests ```bash npm test ``` ## Usage ```js var parser = require('parser-xml'); ``` ### parse ```js parser.parse(str, options, function(err, res) { if (err) { throw err; } console.log(res); }); ``` ### parseFile ```js parser.parseFile('fixtures/a.xml', function (err, res) { if (err) { throw err; } console.log(res); }); ``` ## API ### [parse](index.js#L32) * `str` **{String|Object}**: The object or string to parse. * `options` **{Object|Function}**: or `cb` callback function. * `cb` **{Function}**: callback function. Parse the given `str` of XML and callback `cb(err, data)`. ### [parseFile](index.js#L60) * `str` **{String|Object}**: The object or string to parse. * `returns`: {Object} XML file support. Parse the given `str` of XML and callback `cb(err, data)`. ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parser-xml/issues) ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright (c) 2014 Jon Schlinkert Released under the MIT license *** _This file was generated by [verb](https://github.com/assemble/verb) on November 24, 2014._ [parser-cache]: https://github.com/jonschlinkert/parser-cache
评论
    相关推荐