
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.