readjson

2018-10-23 admin

readjson是什么

什么是readjson,Read file and parse it as json.

readjson使用教程帮助文档

readjson License NPM version Dependency Status Build Status Coverage Status

Read file and parse it as json.

Install

npm i readjson --save

How to use?

var readjson = require('readjson');
readjson('./package.json', function(error, json) {
    if (error)
        console.error(error.message);
    else
        console.log([
            json.name, json.version
        ].join(' '));
});
try {
    readjson.sync('./package.json');
} catch(error) {
    console.log(error.message);
}
readjson.sync.try('./package.json');

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-43444.html

文章标题:readjson

回到顶部