
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
norris-json
Advanced tools
The NORRIS-JSON toolkit is a JSON toolkit written for the NORRIS project, but it can be used independently since it does not have any dependencies (other than vows if you want to run the test cases).
0.2.0
npm install norris-json
load(path, callback(err, data))
Loads a JSON file from a path. NORRIS-JSON supports C-style comments in JSON files, which would be stripped off automatically during loading.
The callback (2nd arg) is called with two parameters: callback(err, data), where the first parameter (err) will be null if the operation is successful, or contains an error object if it failed. The second argument (data) contains the JSON object if the operation is successful.
Example
var njson = require('norris-json').make(); // don't forget to call make()!
njson.load('/path/to/json/file.json', function onRead(err, json) {
console.log(json); // should show the json object
});
loadSync(path)
Asynchronous version of load().
Example
var njson = require('norris-json').make(); // don't forget to call make()!
var json = njson.loadSync('/path/to/json/file.json');
attachToGlobal()
Attaches the API in njson into the global JSON object.
Example
var njson = require('norris-json').make(); // don't forget to call make()
njson.attachToGlobal();
// You can now use load(), loadSync(), etc with JSON
JSON.load('/path/to/json/file.json', function(err, data) { ... });
value(json, namespace [, default value])
A safe way of getting a nested value from a JSON object. First argument takes a JSON object, second argument takes a namespace strin (dot delimited, e.g. "foo.bar.subar"), and third argument (optional) is the default value if no value is found.
This is useful when you want to grab a deeply nested value in a json object but don't want an exception to be thrown whenever the value is not found (gracefully fail instead).
Example
var njson = require('norris-json').make(); // don't forget to call make()
var json = njson.loadSync('/path/to/json/file.json');
/*
The json object looks like this:
{
foo : {
bar : 'yeah!'
}
}
*/
var value = njson.value(json, 'foo.bar'); // returns 'yeah!'
var fail = njson.value(json, 'foo.nobar'); // returns null
var error = json.foo.nobar; // throws an exception!
v0.2.0
v0.1.0
v0.0.2
v0.0.1
attachToGlobal()load() and loadSync() capable of taking in an array of pathsload() and loadSync() capable of using URIs instead of filepaths
mixin(json1, json2)
Mixes in the properties of json2 into json1.
Example
var njson = require('norris-json').make(); // don't forget to call make()!
var json1 = njson.loadSync('/path/to/json/file1.json');
var json2 = njson.loadSync('/path/to/json/file2.json');
var res = njson.mixin(json1, json2);
Copyright (C) 2011 by Ruben LZ Tan
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.
FAQs
JSON toolkit for the NORRIS project (but can be used on its own)
We found that norris-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.