gulp-community / gulp-json-editor Goto Github PK
View Code? Open in Web Editor NEWA gulp plugin to edit JSON objects
License: MIT License
A gulp plugin to edit JSON objects
License: MIT License
Is it possible to pass async version of editor function? Somehow like the following (simplified):
gulp.src("./manifest.json")
.pipe(jeditor(function(json, cb) {
readFile('somefile', function (content) {
json.version = content.version;
cb(json);
});
}))
.pipe(gulp.dest("./dest"));
6.0.2
to 6.1.0
.๐จ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
options
parameter (@plroebuck).jsonc
extension (@sstephant)These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
this.skip()
in "before each" hooks (@juergba)--allow-uncaught
for uncaught exceptions thrown inside hooks (@givanse)and some regressions:
Suite
cloning by copying root
property (@fatso83)The new version differs by 28 commits.
f4fc95a
Release v6.1.0
bd29dbd
update CHANGELOG for v6.1.0 [ci skip]
aaf2b72
Use cwd-relative pathname to load config file (#3829)
b079d24
upgrade deps as per npm audit fix; closes #3854
e87c689
Deprecate this.skip() for "after all" hooks (#3719)
81cfa90
Copy Suite property "root" when cloning; closes #3847 (#3848)
8aa2fc4
Fix issue 3714, hide pound icon showing on hover header on docs page (#3850)
586bf78
Update JS-YAML to address security issue (#3845)
d1024a3
Update doc examples "tests.html" (#3811)
1d570e0
Delete "/docs/example/chai.js"
ade8b90
runner.js: "self.test" undefined in Browser (#3835)
0098147
Replace findup-sync with find-up for faster startup (#3830)
d5ba121
Remove "package" flag from sample config file because it can only be passes as CLI arg (#3793)
a3089ad
update package-lock
75430ec
Upgrade yargs-parser dependency to avoid loading 2 copies of yargs
There are 28 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donโt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot ๐ด
The js-beautify
is out of date and prevents me from using the 'brace-style': 'collapse-preserve-inline'
option, which was fixed for Node in 1.6.2.
Right now I'm trying to use npm shrinkwrap
to work around this, which is a pain. Would be great just to see it updated. ๐
on node version 10.4.1 and 6.0.0 , both of them occur exception. Is it a bug?
TypeError: this is not a typed array. at Function.from (native) at DestroyableTransform._transform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@gulp-json-editor/index.js:71:30) at DestroyableTransform.Transform._read (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:172:83) at doWrite (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:417:5) at DestroyableTransform.Writable.write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_writable.js:334:11) at write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:623:24) at flow (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:632:7) at DestroyableTransform.pipeOnReadable (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:664:5) at emitNone (events.js:67:13) at DestroyableTransform.emit (events.js:166:7) at emitReadable_ (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:448:10) at emitReadable (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:444:5) at readableAddChunk (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:187:9) at DestroyableTransform.Readable.push (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_readable.js:149:10) at DestroyableTransform.Transform.push (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:145:32) at afterTransform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:101:12) at TransformState.afterTransform (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:79:12) at DestroyableTransform.noop [as _transform] (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@through2/through2.js:26:3) at DestroyableTransform.Transform._read (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/Users/a/work/project/AutoUI_Client/node_modules/[email protected]@readable-stream/lib/_stream_transform.js:172:12)
errored after 143 ms
[12:58:14] TypeError in plugin 'gulp-json-editor'
Cannot read property 'length' of undefined
gulp.task('testing', function() {
// return gulp.src('./testing.json')
return run('./testing-generate').exec()
.pipe(plumber())
.pipe(rename("testing-result.json"))
.pipe(jsonlint())
.pipe(jsonedit(function(json) {
return json;
}))
.pipe(gulp.dest('./'))
;
});
[06:04:34] Starting 'testing'...
[06:04:34] Plumber found unhandled error:
Error in plugin 'gulp-json-editor'
Message:
Streaming is not supported
[06:04:34] Finished 'testing' after 61 ms
$ ./testing-generate
{ "bar": true }
Hi @morou
could you also transfer the ownership of this library in the npm registry to me? Otherwise I cannot release a new version :-(
Cheers and Thanks for all your work
gulp-util
has been deprecated recently. Continuing to use this dependency may prevent the use of your library with the latest release of Gulp 4 so it is important to replace gulp-util
.
The README.md lists alternatives for all the components so a simple replacement should be enough.
Your package is one of the most popular packages still relying on gulp-util
, it would be good to publish a fixed version to npm as soon as possible.
See:
In my project the version 2.6.0 broke compatibility so I needed to reset to older versions, because of this error:
Invalid dependency type requested: alias
in these sub dependencies
4461 silly fetchPackageMetaData error for string-width-cjs@npm:string-width@^4.2.0 Invalid dependency type requested: alias
4462 silly fetchPackageMetaData error for strip-ansi-cjs@npm:strip-ansi@^6.0.1 Invalid dependency type requested: alias
4463 silly fetchPackageMetaData error for wrap-ansi-cjs@npm:wrap-ansi@^7.0.0 Invalid dependency type requested: alias
I would like to be able to bypass the beautification process. I can see there's an existing variable that can be used, but it's hard-coded.
I would like this exposed as one of the beautification options.
I'll go ahead and submit a PR, unless I'm missing something.
events.js:141
throw er; // Unhandled 'error' event
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at Transform._transform (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/index.js:65:45)
at Transform._read (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at Transform.Writable.write (/Users/00831103/Workspace/project-2/node_modules/gulp-json-editor/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at write (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/Users/00831103/Workspace/project-2/node_modules/gulp/node_modules/readable-stream/lib/_stream_readable.js:664:5)
code is
var gulp = require('gulp');
var jeditor = require('gulp-json-editor');
gulp.task('addjson','adds basic placeholder json',function(){
return gulp.src('./aggregate.json')
.pipe(jeditor(function(json) {
json = "1.2.3";
return json; // must return JSON object.
}))
.pipe(gulp.dest('.'));
});
Hey,
I might be stupid here, but is it not possible to delete the contents of an object, ie. I am trying to delete all dependencies
and devDependencies
from a package.json
file, like this:
return gulp
.src('package.json')
.pipe(jsonEditor({
'dependencies': {},
'devDependencies': {}
}))
.pipe(gulp.dest(destination))
However, that doesn't seem to work. Any other way of emptying those objects using this gulp package?
Thanx in advance!
Would it be possible to take 2 or 3 JSON objects and merge them into one without duplicates?
I have 3 apps that each have their own menu configured in JSON. They each have menu items inside the same categories so each JSON will have Category1 and so on. I'd like to merge these JSON files together at build time so that at run time the menu doesn't care where the JSON comes from. It just builds the menu.
Is this kind of thing possible with gulp-json-editor?
Thanks,
Bob
5.15.3
to 5.16.0
.๐จ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
dfef227
Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington)c06d38c
Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin)87a5c03
Docs: func-style
: clarify when allowArrowFunctions
is used (#11548) (Oliver Joseph Ash)bc3e427
Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer)b452f27
Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas)afe3d25
Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede)4fe7eb7
Chore: use nyc instead of istanbul (#11532) (Toru Nagashima)f16af43
Chore: fix formatters/table test (#11534) (Toru Nagashima)78358a8
Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz)The new version differs by 11 commits.
ded2f94
5.16.0
ea36e13
Build: changelog update for 5.16.0
dfef227
Build: gensite passes rulesMeta to formatter rendering (#11567)
c06d38c
Fix: Allow HTML formatter to handle no meta data (#11566)
87a5c03
Docs: func-style
: clarify when allowArrowFunctions
is used (#11548)
bc3e427
Update: pass rule meta to formatters RFC 10 (#11551)
b452f27
Chore: Update README to pull in reviewer data (#11506)
afe3d25
Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550)
4fe7eb7
Chore: use nyc instead of istanbul (#11532)
f16af43
Chore: fix formatters/table test (#11534)
78358a8
Docs: fix duplicate punctuation in CLI docs (#11528)
See the full diff
There is a collection of frequently asked questions. If those donโt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot ๐ด
I'd like to set wrap_line_length = 80
in js-beautify
so I can easily read the contents of long arrays. Would you consider exposing the beautify options as an options parameter to json-editor?
Check out Kthulhu.
It's currently not possible to write boolean values into a JSON file. What happens when I try to overwrite an existing key a with boolean value, the entire key will be removed. A workaround is putting booleans in quotes, but thatโof courseโwill only work as long as you don't have to differentiate between true
and "true"
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.