{"id":21565106,"url":"https://github.com/cfware/gulp-add-json-file","last_synced_at":"2025-03-18T05:17:26.668Z","repository":{"id":57256721,"uuid":"168853676","full_name":"cfware/gulp-add-json-file","owner":"cfware","description":"Add a JSON formatted file to a gulp stream.","archived":false,"fork":false,"pushed_at":"2020-05-27T14:33:59.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T12:49:59.891Z","etag":null,"topics":["gulp","gulpplugin","json","vinyl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-02T16:48:59.000Z","updated_at":"2020-05-07T12:20:48.000Z","dependencies_parsed_at":"2022-08-25T02:30:58.782Z","dependency_job_id":null,"html_url":"https://github.com/cfware/gulp-add-json-file","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-add-json-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-add-json-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-add-json-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-add-json-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfware","download_url":"https://codeload.github.com/cfware/gulp-add-json-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244160055,"owners_count":20408021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gulp","gulpplugin","json","vinyl"],"created_at":"2024-11-24T10:18:26.839Z","updated_at":"2025-03-18T05:17:26.646Z","avatar_url":"https://github.com/cfware.png","language":"JavaScript","readme":"# gulp-add-json-file\n\n[![Travis CI][travis-image]][travis-url]\n[![Greenkeeper badge][gk-image]](https://greenkeeper.io/)\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![MIT][license-image]](LICENSE)\n\nAdd a JSON formatted file to a gulp stream.\n\n### Install gulp-add-json-file\n\nThis module requires node.js 13.8.0 or above.\n\n```sh\nnpm i -D gulp gulp-add-json-file\n```\n\n## Usage\n\n```js\nimport {promisify} from 'util';\nimport stream from 'stream';\n\nimport gulp from 'gulp';\nimport gulpAddJSON from 'gulp-add-json-file';\n\nconst pipeline = promisify(stream.pipeline);\n\ngulp.task('default', () =\u003e {\n\t/* Copy 'src/**' to 'dest', add 'filename.json' from JS object. */\n\treturn pipeline(\n\t\tgulp.src('src/**'),\n\t\tgulpAddJSON('filename.json', {field: 'value'}),\n\t\tgulp.dest('dest')\n\t);\n});\n```\n\n### gulpAddJSON(filename, object, space)\n\n* **filename**: The filename to use when adding a vinyl object\n* **object**: The JavaScript object to stringify as contents of the vinyl object\n* **space**: Passed directly to [JSON.stringify].\n\n## U+2028 and U+2029\n\nLiteral code points U+2028 and U+2029 are escaped for maximum compatibility.\n\n## Duplicate files\n\nThis module should not be used to add a duplicate filename to the gulp stream.  In\nthe above example if `src/filename.json` exists it should be filtered out from\n`gulp.src`.\n\n\n[npm-image]: https://img.shields.io/npm/v/gulp-add-json-file.svg\n[npm-url]: https://npmjs.org/package/gulp-add-json-file\n[travis-image]: https://travis-ci.org/cfware/gulp-add-json-file.svg?branch=master\n[travis-url]: https://travis-ci.org/cfware/gulp-add-json-file\n[gk-image]: https://badges.greenkeeper.io/cfware/gulp-add-json-file.svg\n[downloads-image]: https://img.shields.io/npm/dm/gulp-add-json-file.svg\n[downloads-url]: https://npmjs.org/package/gulp-add-json-file\n[license-image]: https://img.shields.io/npm/l/gulp-add-json-file.svg\n[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fgulp-add-json-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfware%2Fgulp-add-json-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fgulp-add-json-file/lists"}