
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
View plugin for templates.js, assemble or verb, that calls JSON.parse on .json files and keeps `file.content` in sync with `file.json.data`.
View plugin for templates.js, assemble or verb, that calls JSON.parse on .json files and keeps
file.contentin sync withfile.json.data.
Install with npm:
$ npm i view-json --save
The use case for this is to be able to easily update values on a JSON file as it progresses through a plugin pipeline or middleware stack (without having to repeatedly write the code to parse and stringify it).
Can be used with any application based on templates, including assemble, verb, and update.
var json = require('view-json');
var templates = require('templates');
var app = templates();
app.use(json());
.json extension is created, this plugin automatically parses the file.contents property and adds the resulting object to file.json.data.file.json has .get and .set methods for getting or setting properties from file.data.set is called, file.data and file.content are both updated.Example
// create a collection
app.create('files');
// add a "view" to the new collection
var file = app.file('package.json', {content: '{"name": "foo"}'});
console.log(file.json.get('name'));
//=> "foo"
file.json.set('name', 'bar');
console.log(file.contents.toString());
//=> '{"name": "bar"}'
fwiw, with minor modifications this could also be used with vinyl files. Let me know if you're interested by creating an issue, and I'll make the modifications.
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb on January 23, 2016.
FAQs
View plugin for templates.js, assemble or verb, that calls JSON.parse on .json files and keeps `file.content` in sync with `file.json.data`.
We found that view-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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.