@oneblink/release-cli 1.2.0-beta.2 → 1.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@yarnpkg/lockfile/README.md +22 -0
- package/node_modules/@yarnpkg/lockfile/index.js +10273 -0
- package/node_modules/@yarnpkg/lockfile/package.json +19 -0
- package/node_modules/ansi-styles/index.js +165 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +60 -0
- package/node_modules/ansi-styles/readme.md +147 -0
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +52 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/brace-expansion/package.json +51 -0
- package/node_modules/braces/CHANGELOG.md +184 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +593 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +57 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +333 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +112 -0
- package/node_modules/braces/package.json +81 -0
- package/node_modules/chalk/index.js +228 -0
- package/node_modules/chalk/index.js.flow +93 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +75 -0
- package/node_modules/chalk/readme.md +314 -0
- package/node_modules/chalk/templates.js +128 -0
- package/node_modules/chalk/types/index.d.ts +97 -0
- package/node_modules/changelog-parser/.DS_Store +0 -0
- package/node_modules/changelog-parser/.travis.yml +7 -0
- package/node_modules/changelog-parser/CHANGELOG.md +128 -0
- package/node_modules/changelog-parser/CONTRIBUTING.md +55 -0
- package/node_modules/changelog-parser/LICENSE.md +15 -0
- package/node_modules/changelog-parser/README.md +247 -0
- package/node_modules/changelog-parser/bin/cli.js +19 -0
- package/node_modules/changelog-parser/index.js +201 -0
- package/node_modules/changelog-parser/package.json +54 -0
- package/node_modules/changelog-parser/test/fixtures/CHANGELOG.md +44 -0
- package/node_modules/changelog-parser/test/fixtures/expected.js +113 -0
- package/node_modules/changelog-parser/test/fixtures/remove-markdown-expected.js +113 -0
- package/node_modules/changelog-parser/test/index.js +105 -0
- package/node_modules/ci-info/CHANGELOG.md +78 -0
- package/node_modules/ci-info/LICENSE +21 -0
- package/node_modules/ci-info/README.md +108 -0
- package/node_modules/ci-info/index.js +66 -0
- package/node_modules/ci-info/package.json +40 -0
- package/node_modules/ci-info/vendors.json +153 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +868 -0
- package/node_modules/color-convert/index.js +78 -0
- package/node_modules/color-convert/package.json +50 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/.eslintrc.json +43 -0
- package/node_modules/color-name/.npmignore +107 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +29 -0
- package/node_modules/color-name/test.js +7 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +47 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/escape-string-regexp/index.js +11 -0
- package/node_modules/escape-string-regexp/license +21 -0
- package/node_modules/escape-string-regexp/package.json +45 -0
- package/node_modules/escape-string-regexp/readme.md +27 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +249 -0
- package/node_modules/fill-range/package.json +73 -0
- package/node_modules/find-yarn-workspace-root/CHANGELOG.md +53 -0
- package/node_modules/find-yarn-workspace-root/LICENSE +201 -0
- package/node_modules/find-yarn-workspace-root/README.md +56 -0
- package/node_modules/find-yarn-workspace-root/index.d.ts +3 -0
- package/node_modules/find-yarn-workspace-root/index.js +53 -0
- package/node_modules/find-yarn-workspace-root/package.json +38 -0
- package/node_modules/fs-extra/CHANGELOG.md +842 -0
- package/node_modules/fs-extra/LICENSE +15 -0
- package/node_modules/fs-extra/README.md +261 -0
- package/node_modules/fs-extra/lib/copy/copy.js +246 -0
- package/node_modules/fs-extra/lib/copy/index.js +6 -0
- package/node_modules/fs-extra/lib/copy-sync/copy-sync.js +193 -0
- package/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
- package/node_modules/fs-extra/lib/empty/index.js +48 -0
- package/node_modules/fs-extra/lib/ensure/file.js +49 -0
- package/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/node_modules/fs-extra/lib/ensure/link.js +61 -0
- package/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
- package/node_modules/fs-extra/lib/fs/index.js +104 -0
- package/node_modules/fs-extra/lib/index.js +28 -0
- package/node_modules/fs-extra/lib/json/index.js +16 -0
- package/node_modules/fs-extra/lib/json/jsonfile.js +12 -0
- package/node_modules/fs-extra/lib/json/output-json-sync.js +18 -0
- package/node_modules/fs-extra/lib/json/output-json.js +27 -0
- package/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js +54 -0
- package/node_modules/fs-extra/lib/mkdirs/mkdirs.js +63 -0
- package/node_modules/fs-extra/lib/mkdirs/win32.js +25 -0
- package/node_modules/fs-extra/lib/move/index.js +82 -0
- package/node_modules/fs-extra/lib/move-sync/index.js +117 -0
- package/node_modules/fs-extra/lib/output/index.js +40 -0
- package/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/node_modules/fs-extra/lib/remove/index.js +9 -0
- package/node_modules/fs-extra/lib/remove/rimraf.js +314 -0
- package/node_modules/fs-extra/lib/util/buffer.js +12 -0
- package/node_modules/fs-extra/lib/util/utimes.js +79 -0
- package/node_modules/fs-extra/package.json +72 -0
- package/node_modules/fs.realpath/LICENSE +43 -0
- package/node_modules/fs.realpath/README.md +33 -0
- package/node_modules/fs.realpath/index.js +66 -0
- package/node_modules/fs.realpath/old.js +303 -0
- package/node_modules/fs.realpath/package.json +30 -0
- package/node_modules/glob/LICENSE +21 -0
- package/node_modules/glob/README.md +375 -0
- package/node_modules/glob/changelog.md +67 -0
- package/node_modules/glob/common.js +240 -0
- package/node_modules/glob/glob.js +790 -0
- package/node_modules/glob/package.json +50 -0
- package/node_modules/glob/sync.js +486 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +133 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +373 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +54 -0
- package/node_modules/graceful-fs/polyfills.js +346 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +48 -0
- package/node_modules/has-flag/readme.md +70 -0
- package/node_modules/inflight/LICENSE +15 -0
- package/node_modules/inflight/README.md +37 -0
- package/node_modules/inflight/inflight.js +54 -0
- package/node_modules/inflight/package.json +33 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +33 -0
- package/node_modules/is-ci/CHANGELOG.md +14 -0
- package/node_modules/is-ci/LICENSE +21 -0
- package/node_modules/is-ci/README.md +50 -0
- package/node_modules/is-ci/bin.js +4 -0
- package/node_modules/is-ci/index.js +3 -0
- package/node_modules/is-ci/package.json +42 -0
- package/node_modules/is-docker/cli.js +5 -0
- package/node_modules/is-docker/index.d.ts +15 -0
- package/node_modules/is-docker/index.js +29 -0
- package/node_modules/is-docker/license +9 -0
- package/node_modules/is-docker/package.json +46 -0
- package/node_modules/is-docker/readme.md +27 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +86 -0
- package/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/is-wsl/index.js +31 -0
- package/node_modules/is-wsl/license +9 -0
- package/node_modules/is-wsl/package.json +49 -0
- package/node_modules/is-wsl/readme.md +36 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +35 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jsonfile/CHANGELOG.md +145 -0
- package/node_modules/jsonfile/LICENSE +15 -0
- package/node_modules/jsonfile/README.md +168 -0
- package/node_modules/jsonfile/index.js +134 -0
- package/node_modules/jsonfile/package.json +41 -0
- package/node_modules/klaw-sync/CHANGELOG.md +73 -0
- package/node_modules/klaw-sync/LICENSE +20 -0
- package/node_modules/klaw-sync/README.md +164 -0
- package/node_modules/klaw-sync/klaw-sync.js +29 -0
- package/node_modules/klaw-sync/package.json +51 -0
- package/node_modules/line-reader/LICENSE +20 -0
- package/node_modules/line-reader/README.md +75 -0
- package/node_modules/line-reader/lib/line_reader.js +174 -0
- package/node_modules/line-reader/package.json +18 -0
- package/node_modules/line-reader/test/data/empty_file.txt +0 -0
- package/node_modules/line-reader/test/data/multi_separator_file.txt +2 -0
- package/node_modules/line-reader/test/data/multibyte_file.txt +2 -0
- package/node_modules/line-reader/test/data/normal_file.txt +6 -0
- package/node_modules/line-reader/test/data/one_line_file.txt +1 -0
- package/node_modules/line-reader/test/data/separator_file.txt +2 -0
- package/node_modules/line-reader/test/data/three_line_file.txt +3 -0
- package/node_modules/line-reader/test/line_reader.js +222 -0
- package/node_modules/lru-cache/LICENSE +15 -0
- package/node_modules/lru-cache/README.md +166 -0
- package/node_modules/lru-cache/index.js +334 -0
- package/node_modules/lru-cache/package.json +38 -0
- package/node_modules/micromatch/CHANGELOG.md +109 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1008 -0
- package/node_modules/micromatch/index.js +467 -0
- package/node_modules/micromatch/package.json +123 -0
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +209 -0
- package/node_modules/minimatch/minimatch.js +923 -0
- package/node_modules/minimatch/package.json +34 -0
- package/node_modules/minimist/.travis.yml +8 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/example/parse.js +2 -0
- package/node_modules/minimist/index.js +245 -0
- package/node_modules/minimist/package.json +49 -0
- package/node_modules/minimist/readme.markdown +95 -0
- package/node_modules/minimist/test/all_bool.js +32 -0
- package/node_modules/minimist/test/bool.js +178 -0
- package/node_modules/minimist/test/dash.js +31 -0
- package/node_modules/minimist/test/default_bool.js +35 -0
- package/node_modules/minimist/test/dotted.js +22 -0
- package/node_modules/minimist/test/kv_short.js +16 -0
- package/node_modules/minimist/test/long.js +31 -0
- package/node_modules/minimist/test/num.js +36 -0
- package/node_modules/minimist/test/parse.js +197 -0
- package/node_modules/minimist/test/parse_modified.js +9 -0
- package/node_modules/minimist/test/proto.js +44 -0
- package/node_modules/minimist/test/short.js +67 -0
- package/node_modules/minimist/test/stop_early.js +15 -0
- package/node_modules/minimist/test/unknown.js +102 -0
- package/node_modules/minimist/test/whitespace.js +8 -0
- package/node_modules/nice-try/CHANGELOG.md +21 -0
- package/node_modules/nice-try/LICENSE +21 -0
- package/node_modules/nice-try/README.md +32 -0
- package/node_modules/nice-try/package.json +37 -0
- package/node_modules/nice-try/src/index.js +12 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +37 -0
- package/node_modules/open/index.d.ts +88 -0
- package/node_modules/open/index.js +195 -0
- package/node_modules/open/license +9 -0
- package/node_modules/open/package.json +64 -0
- package/node_modules/open/readme.md +154 -0
- package/node_modules/open/xdg-open +1066 -0
- package/node_modules/os-tmpdir/index.js +25 -0
- package/node_modules/os-tmpdir/license +21 -0
- package/node_modules/os-tmpdir/package.json +45 -0
- package/node_modules/os-tmpdir/readme.md +32 -0
- package/node_modules/patch-package/CHANGELOG.md +389 -0
- package/node_modules/patch-package/LICENSE +19 -0
- package/node_modules/patch-package/README.md +269 -0
- package/node_modules/patch-package/dist/PackageDetails.js +102 -0
- package/node_modules/patch-package/dist/PackageDetails.test.js +228 -0
- package/node_modules/patch-package/dist/applyPatches.js +261 -0
- package/node_modules/patch-package/dist/assertNever.js +8 -0
- package/node_modules/patch-package/dist/createIssue.js +83 -0
- package/node_modules/patch-package/dist/detectPackageManager.js +64 -0
- package/node_modules/patch-package/dist/filterFiles.js +17 -0
- package/node_modules/patch-package/dist/getAppRootPath.js +22 -0
- package/node_modules/patch-package/dist/getPackageResolution.js +85 -0
- package/node_modules/patch-package/dist/getPackageVersion.js +9 -0
- package/node_modules/patch-package/dist/index.js +161 -0
- package/node_modules/patch-package/dist/makePatch.js +231 -0
- package/node_modules/patch-package/dist/makeRegExp.js +28 -0
- package/node_modules/patch-package/dist/packageIsDevDependency.js +15 -0
- package/node_modules/patch-package/dist/packageIsDevDependency.test.js +32 -0
- package/node_modules/patch-package/dist/patch/apply.js +197 -0
- package/node_modules/patch-package/dist/patch/parse.js +330 -0
- package/node_modules/patch-package/dist/patch/read.js +49 -0
- package/node_modules/patch-package/dist/patch/reverse.js +96 -0
- package/node_modules/patch-package/dist/patchFs.js +20 -0
- package/node_modules/patch-package/dist/path.js +17 -0
- package/node_modules/patch-package/dist/resolveRelativeFileDependencies.js +21 -0
- package/node_modules/patch-package/dist/resolveRelativeFileDependencies.test.js +22 -0
- package/node_modules/patch-package/dist/spawnSafe.js +28 -0
- package/node_modules/patch-package/index.js +3 -0
- package/node_modules/patch-package/node_modules/cross-spawn/CHANGELOG.md +100 -0
- package/node_modules/patch-package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/patch-package/node_modules/cross-spawn/README.md +94 -0
- package/node_modules/patch-package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/parse.js +125 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/escape.js +45 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
- package/node_modules/patch-package/node_modules/cross-spawn/lib/util/resolveCommand.js +47 -0
- package/node_modules/patch-package/node_modules/cross-spawn/package.json +80 -0
- package/node_modules/patch-package/node_modules/path-key/index.js +13 -0
- package/node_modules/patch-package/node_modules/path-key/license +21 -0
- package/node_modules/patch-package/node_modules/path-key/package.json +43 -0
- package/node_modules/patch-package/node_modules/path-key/readme.md +51 -0
- package/node_modules/patch-package/node_modules/rimraf/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/rimraf/README.md +101 -0
- package/node_modules/patch-package/node_modules/rimraf/bin.js +50 -0
- package/node_modules/patch-package/node_modules/rimraf/package.json +33 -0
- package/node_modules/patch-package/node_modules/rimraf/rimraf.js +372 -0
- package/node_modules/patch-package/node_modules/semver/CHANGELOG.md +39 -0
- package/node_modules/patch-package/node_modules/semver/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/semver/README.md +412 -0
- package/node_modules/patch-package/node_modules/semver/bin/semver +160 -0
- package/node_modules/patch-package/node_modules/semver/package.json +32 -0
- package/node_modules/patch-package/node_modules/semver/range.bnf +16 -0
- package/node_modules/patch-package/node_modules/semver/semver.js +1483 -0
- package/node_modules/patch-package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/patch-package/node_modules/shebang-command/license +21 -0
- package/node_modules/patch-package/node_modules/shebang-command/package.json +43 -0
- package/node_modules/patch-package/node_modules/shebang-command/readme.md +39 -0
- package/node_modules/patch-package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/patch-package/node_modules/shebang-regex/license +21 -0
- package/node_modules/patch-package/node_modules/shebang-regex/package.json +36 -0
- package/node_modules/patch-package/node_modules/shebang-regex/readme.md +29 -0
- package/node_modules/patch-package/node_modules/slash/index.js +11 -0
- package/node_modules/patch-package/node_modules/slash/license +9 -0
- package/node_modules/patch-package/node_modules/slash/package.json +38 -0
- package/node_modules/patch-package/node_modules/slash/readme.md +44 -0
- package/node_modules/patch-package/node_modules/which/CHANGELOG.md +152 -0
- package/node_modules/patch-package/node_modules/which/LICENSE +15 -0
- package/node_modules/patch-package/node_modules/which/README.md +51 -0
- package/node_modules/patch-package/node_modules/which/bin/which +52 -0
- package/node_modules/patch-package/node_modules/which/package.json +34 -0
- package/node_modules/patch-package/node_modules/which/which.js +135 -0
- package/node_modules/patch-package/package.json +100 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +47 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/picomatch/CHANGELOG.md +120 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +691 -0
- package/node_modules/picomatch/index.js +3 -0
- package/node_modules/picomatch/lib/constants.js +179 -0
- package/node_modules/picomatch/lib/parse.js +1078 -0
- package/node_modules/picomatch/lib/picomatch.js +339 -0
- package/node_modules/picomatch/lib/scan.js +385 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +85 -0
- package/node_modules/remove-markdown/.npmignore +1 -0
- package/node_modules/remove-markdown/LICENSE +21 -0
- package/node_modules/remove-markdown/README.md +44 -0
- package/node_modules/remove-markdown/index.js +60 -0
- package/node_modules/remove-markdown/package.json +31 -0
- package/node_modules/remove-markdown/test/remove-markdown.js +139 -0
- package/node_modules/semver/CHANGELOG.md +111 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +566 -0
- package/node_modules/semver/bin/semver.js +173 -0
- package/node_modules/semver/classes/comparator.js +135 -0
- package/node_modules/semver/classes/index.js +5 -0
- package/node_modules/semver/classes/range.js +510 -0
- package/node_modules/semver/classes/semver.js +287 -0
- package/node_modules/semver/functions/clean.js +6 -0
- package/node_modules/semver/functions/cmp.js +48 -0
- package/node_modules/semver/functions/coerce.js +51 -0
- package/node_modules/semver/functions/compare-build.js +7 -0
- package/node_modules/semver/functions/compare-loose.js +3 -0
- package/node_modules/semver/functions/compare.js +5 -0
- package/node_modules/semver/functions/diff.js +23 -0
- package/node_modules/semver/functions/eq.js +3 -0
- package/node_modules/semver/functions/gt.js +3 -0
- package/node_modules/semver/functions/gte.js +3 -0
- package/node_modules/semver/functions/inc.js +15 -0
- package/node_modules/semver/functions/lt.js +3 -0
- package/node_modules/semver/functions/lte.js +3 -0
- package/node_modules/semver/functions/major.js +3 -0
- package/node_modules/semver/functions/minor.js +3 -0
- package/node_modules/semver/functions/neq.js +3 -0
- package/node_modules/semver/functions/parse.js +33 -0
- package/node_modules/semver/functions/patch.js +3 -0
- package/node_modules/semver/functions/prerelease.js +6 -0
- package/node_modules/semver/functions/rcompare.js +3 -0
- package/node_modules/semver/functions/rsort.js +3 -0
- package/node_modules/semver/functions/satisfies.js +10 -0
- package/node_modules/semver/functions/sort.js +3 -0
- package/node_modules/semver/functions/valid.js +6 -0
- package/node_modules/semver/index.js +48 -0
- package/node_modules/semver/internal/constants.js +17 -0
- package/node_modules/semver/internal/debug.js +9 -0
- package/node_modules/semver/internal/identifiers.js +23 -0
- package/node_modules/semver/internal/parse-options.js +11 -0
- package/node_modules/semver/internal/re.js +182 -0
- package/node_modules/semver/package.json +45 -0
- package/node_modules/semver/preload.js +2 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +4 -0
- package/node_modules/semver/ranges/intersects.js +7 -0
- package/node_modules/semver/ranges/ltr.js +4 -0
- package/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/node_modules/semver/ranges/min-version.js +60 -0
- package/node_modules/semver/ranges/outside.js +80 -0
- package/node_modules/semver/ranges/simplify.js +44 -0
- package/node_modules/semver/ranges/subset.js +222 -0
- package/node_modules/semver/ranges/to-comparators.js +8 -0
- package/node_modules/semver/ranges/valid.js +11 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +131 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +57 -0
- package/node_modules/supports-color/readme.md +66 -0
- package/node_modules/tmp/LICENSE +21 -0
- package/node_modules/tmp/README.md +314 -0
- package/node_modules/tmp/lib/tmp.js +611 -0
- package/node_modules/tmp/package.json +42 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +92 -0
- package/node_modules/universalify/LICENSE +20 -0
- package/node_modules/universalify/README.md +76 -0
- package/node_modules/universalify/index.js +25 -0
- package/node_modules/universalify/package.json +38 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +33 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/yallist/LICENSE +15 -0
- package/node_modules/yallist/README.md +204 -0
- package/node_modules/yallist/iterator.js +8 -0
- package/node_modules/yallist/package.json +33 -0
- package/node_modules/yallist/yallist.js +426 -0
- package/package.json +5 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
4.0.0 / 2017-07-12
|
|
2
|
+
------------------
|
|
3
|
+
|
|
4
|
+
- **BREAKING:** Remove global `spaces` option.
|
|
5
|
+
- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js.
|
|
6
|
+
- Remove undocumented `passParsingErrors` option.
|
|
7
|
+
- Added `EOL` override option to `writeFile` when using `spaces`. [#89]
|
|
8
|
+
|
|
9
|
+
3.0.1 / 2017-07-05
|
|
10
|
+
------------------
|
|
11
|
+
|
|
12
|
+
- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written.
|
|
13
|
+
|
|
14
|
+
3.0.0 / 2017-04-25
|
|
15
|
+
------------------
|
|
16
|
+
|
|
17
|
+
- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false`
|
|
18
|
+
|
|
19
|
+
2.4.0 / 2016-09-15
|
|
20
|
+
------------------
|
|
21
|
+
### Changed
|
|
22
|
+
- added optional support for `graceful-fs` [#62]
|
|
23
|
+
|
|
24
|
+
2.3.1 / 2016-05-13
|
|
25
|
+
------------------
|
|
26
|
+
- fix to support BOM. [#45][#45]
|
|
27
|
+
|
|
28
|
+
2.3.0 / 2016-04-16
|
|
29
|
+
------------------
|
|
30
|
+
- add `throws` to `readFile()`. See [#39][#39]
|
|
31
|
+
- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs)
|
|
32
|
+
|
|
33
|
+
2.2.3 / 2015-10-14
|
|
34
|
+
------------------
|
|
35
|
+
- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34
|
|
36
|
+
|
|
37
|
+
2.2.2 / 2015-09-16
|
|
38
|
+
------------------
|
|
39
|
+
- split out tests into separate files
|
|
40
|
+
- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33
|
|
41
|
+
|
|
42
|
+
2.2.1 / 2015-06-25
|
|
43
|
+
------------------
|
|
44
|
+
- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28
|
|
45
|
+
|
|
46
|
+
2.2.0 / 2015-06-25
|
|
47
|
+
------------------
|
|
48
|
+
- added `options.spaces` to `writeFile()` and `writeFileSync()`
|
|
49
|
+
|
|
50
|
+
2.1.2 / 2015-06-22
|
|
51
|
+
------------------
|
|
52
|
+
- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25
|
|
53
|
+
|
|
54
|
+
2.1.1 / 2015-06-19
|
|
55
|
+
------------------
|
|
56
|
+
- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24
|
|
57
|
+
|
|
58
|
+
2.1.0 / 2015-06-19
|
|
59
|
+
------------------
|
|
60
|
+
- cleanup: JavaScript Standard Style, rename files, dropped terst for assert
|
|
61
|
+
- methods now support JSON revivers/replacers
|
|
62
|
+
|
|
63
|
+
2.0.1 / 2015-05-24
|
|
64
|
+
------------------
|
|
65
|
+
- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21
|
|
66
|
+
|
|
67
|
+
2.0.0 / 2014-07-28
|
|
68
|
+
------------------
|
|
69
|
+
* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14)
|
|
70
|
+
* added `options.throws` to `readFileSync()`
|
|
71
|
+
* dropped support for Node v0.8
|
|
72
|
+
|
|
73
|
+
1.2.0 / 2014-06-29
|
|
74
|
+
------------------
|
|
75
|
+
* removed semicolons
|
|
76
|
+
* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but
|
|
77
|
+
changes it according to docs. [#12][#12]
|
|
78
|
+
|
|
79
|
+
1.1.1 / 2013-11-11
|
|
80
|
+
------------------
|
|
81
|
+
* fixed catching of callback bug (ffissore / #5)
|
|
82
|
+
|
|
83
|
+
1.1.0 / 2013-10-11
|
|
84
|
+
------------------
|
|
85
|
+
* added `options` param to methods, (seanodell / #4)
|
|
86
|
+
|
|
87
|
+
1.0.1 / 2013-09-05
|
|
88
|
+
------------------
|
|
89
|
+
* removed `homepage` field from package.json to remove NPM warning
|
|
90
|
+
|
|
91
|
+
1.0.0 / 2013-06-28
|
|
92
|
+
------------------
|
|
93
|
+
* added `.npmignore`, #1
|
|
94
|
+
* changed spacing default from `4` to `2` to follow Node conventions
|
|
95
|
+
|
|
96
|
+
0.0.1 / 2012-09-10
|
|
97
|
+
------------------
|
|
98
|
+
* Initial release.
|
|
99
|
+
|
|
100
|
+
[#89]: https://github.com/jprichardson/node-jsonfile/pull/89
|
|
101
|
+
[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails"
|
|
102
|
+
[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file"
|
|
103
|
+
[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file"
|
|
104
|
+
[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch"
|
|
105
|
+
[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working"
|
|
106
|
+
[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value"
|
|
107
|
+
[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)"
|
|
108
|
+
[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature"
|
|
109
|
+
[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file"
|
|
110
|
+
[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file."
|
|
111
|
+
[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file."
|
|
112
|
+
[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename"
|
|
113
|
+
[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()"
|
|
114
|
+
[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?"
|
|
115
|
+
[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string"
|
|
116
|
+
[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?"
|
|
117
|
+
[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?"
|
|
118
|
+
[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken "
|
|
119
|
+
[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality"
|
|
120
|
+
[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra"
|
|
121
|
+
[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods"
|
|
122
|
+
[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error"
|
|
123
|
+
[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync"
|
|
124
|
+
[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated"
|
|
125
|
+
[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute"
|
|
126
|
+
[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity"
|
|
127
|
+
[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method"
|
|
128
|
+
[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods"
|
|
129
|
+
[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem"
|
|
130
|
+
[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null"
|
|
131
|
+
[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`"
|
|
132
|
+
[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF"
|
|
133
|
+
[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline"
|
|
134
|
+
[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options"
|
|
135
|
+
[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync"
|
|
136
|
+
[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile"
|
|
137
|
+
[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example."
|
|
138
|
+
[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me."
|
|
139
|
+
[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message"
|
|
140
|
+
[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible"
|
|
141
|
+
[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite."
|
|
142
|
+
[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync"
|
|
143
|
+
[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2"
|
|
144
|
+
[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted."
|
|
145
|
+
[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012-2015, JP Richardson <jprichardson@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
6
|
+
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
7
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
13
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
14
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
15
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Node.js - jsonfile
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
Easily read/write JSON files.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.org/package/jsonfile)
|
|
7
|
+
[](http://travis-ci.org/jprichardson/node-jsonfile)
|
|
8
|
+
[](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master)
|
|
9
|
+
|
|
10
|
+
<a href="https://github.com/feross/standard"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100"></a>
|
|
11
|
+
|
|
12
|
+
Why?
|
|
13
|
+
----
|
|
14
|
+
|
|
15
|
+
Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Installation
|
|
20
|
+
------------
|
|
21
|
+
|
|
22
|
+
npm install --save jsonfile
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
API
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### readFile(filename, [options], callback)
|
|
30
|
+
|
|
31
|
+
`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
|
32
|
+
- `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback.
|
|
33
|
+
If `false`, returns `null` for the object.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
var jsonfile = require('jsonfile')
|
|
38
|
+
var file = '/tmp/data.json'
|
|
39
|
+
jsonfile.readFile(file, function(err, obj) {
|
|
40
|
+
console.dir(obj)
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### readFileSync(filename, [options])
|
|
46
|
+
|
|
47
|
+
`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
|
48
|
+
- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object.
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
var jsonfile = require('jsonfile')
|
|
52
|
+
var file = '/tmp/data.json'
|
|
53
|
+
|
|
54
|
+
console.dir(jsonfile.readFileSync(file))
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### writeFile(filename, obj, [options], callback)
|
|
59
|
+
|
|
60
|
+
`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
var jsonfile = require('jsonfile')
|
|
65
|
+
|
|
66
|
+
var file = '/tmp/data.json'
|
|
67
|
+
var obj = {name: 'JP'}
|
|
68
|
+
|
|
69
|
+
jsonfile.writeFile(file, obj, function (err) {
|
|
70
|
+
console.error(err)
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**formatting with spaces:**
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
var jsonfile = require('jsonfile')
|
|
78
|
+
|
|
79
|
+
var file = '/tmp/data.json'
|
|
80
|
+
var obj = {name: 'JP'}
|
|
81
|
+
|
|
82
|
+
jsonfile.writeFile(file, obj, {spaces: 2}, function(err) {
|
|
83
|
+
console.error(err)
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**overriding EOL:**
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
var jsonfile = require('jsonfile')
|
|
91
|
+
|
|
92
|
+
var file = '/tmp/data.json'
|
|
93
|
+
var obj = {name: 'JP'}
|
|
94
|
+
|
|
95
|
+
jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) {
|
|
96
|
+
console.error(err)
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**appending to an existing JSON file:**
|
|
101
|
+
|
|
102
|
+
You can use `fs.writeFile` option `{flag: 'a'}` to achieve this.
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
var jsonfile = require('jsonfile')
|
|
106
|
+
|
|
107
|
+
var file = '/tmp/mayAlreadyExistedData.json'
|
|
108
|
+
var obj = {name: 'JP'}
|
|
109
|
+
|
|
110
|
+
jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) {
|
|
111
|
+
console.error(err)
|
|
112
|
+
})
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### writeFileSync(filename, obj, [options])
|
|
116
|
+
|
|
117
|
+
`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
var jsonfile = require('jsonfile')
|
|
121
|
+
|
|
122
|
+
var file = '/tmp/data.json'
|
|
123
|
+
var obj = {name: 'JP'}
|
|
124
|
+
|
|
125
|
+
jsonfile.writeFileSync(file, obj)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**formatting with spaces:**
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
var jsonfile = require('jsonfile')
|
|
132
|
+
|
|
133
|
+
var file = '/tmp/data.json'
|
|
134
|
+
var obj = {name: 'JP'}
|
|
135
|
+
|
|
136
|
+
jsonfile.writeFileSync(file, obj, {spaces: 2})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**overriding EOL:**
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
var jsonfile = require('jsonfile')
|
|
143
|
+
|
|
144
|
+
var file = '/tmp/data.json'
|
|
145
|
+
var obj = {name: 'JP'}
|
|
146
|
+
|
|
147
|
+
jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'})
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**appending to an existing JSON file:**
|
|
151
|
+
|
|
152
|
+
You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this.
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
var jsonfile = require('jsonfile')
|
|
156
|
+
|
|
157
|
+
var file = '/tmp/mayAlreadyExistedData.json'
|
|
158
|
+
var obj = {name: 'JP'}
|
|
159
|
+
|
|
160
|
+
jsonfile.writeFileSync(file, obj, {flag: 'a'})
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
License
|
|
164
|
+
-------
|
|
165
|
+
|
|
166
|
+
(MIT License)
|
|
167
|
+
|
|
168
|
+
Copyright 2012-2016, JP Richardson <jprichardson@gmail.com>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var _fs
|
|
2
|
+
try {
|
|
3
|
+
_fs = require('graceful-fs')
|
|
4
|
+
} catch (_) {
|
|
5
|
+
_fs = require('fs')
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function readFile (file, options, callback) {
|
|
9
|
+
if (callback == null) {
|
|
10
|
+
callback = options
|
|
11
|
+
options = {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof options === 'string') {
|
|
15
|
+
options = {encoding: options}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
options = options || {}
|
|
19
|
+
var fs = options.fs || _fs
|
|
20
|
+
|
|
21
|
+
var shouldThrow = true
|
|
22
|
+
if ('throws' in options) {
|
|
23
|
+
shouldThrow = options.throws
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fs.readFile(file, options, function (err, data) {
|
|
27
|
+
if (err) return callback(err)
|
|
28
|
+
|
|
29
|
+
data = stripBom(data)
|
|
30
|
+
|
|
31
|
+
var obj
|
|
32
|
+
try {
|
|
33
|
+
obj = JSON.parse(data, options ? options.reviver : null)
|
|
34
|
+
} catch (err2) {
|
|
35
|
+
if (shouldThrow) {
|
|
36
|
+
err2.message = file + ': ' + err2.message
|
|
37
|
+
return callback(err2)
|
|
38
|
+
} else {
|
|
39
|
+
return callback(null, null)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
callback(null, obj)
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function readFileSync (file, options) {
|
|
48
|
+
options = options || {}
|
|
49
|
+
if (typeof options === 'string') {
|
|
50
|
+
options = {encoding: options}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var fs = options.fs || _fs
|
|
54
|
+
|
|
55
|
+
var shouldThrow = true
|
|
56
|
+
if ('throws' in options) {
|
|
57
|
+
shouldThrow = options.throws
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
var content = fs.readFileSync(file, options)
|
|
62
|
+
content = stripBom(content)
|
|
63
|
+
return JSON.parse(content, options.reviver)
|
|
64
|
+
} catch (err) {
|
|
65
|
+
if (shouldThrow) {
|
|
66
|
+
err.message = file + ': ' + err.message
|
|
67
|
+
throw err
|
|
68
|
+
} else {
|
|
69
|
+
return null
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function stringify (obj, options) {
|
|
75
|
+
var spaces
|
|
76
|
+
var EOL = '\n'
|
|
77
|
+
if (typeof options === 'object' && options !== null) {
|
|
78
|
+
if (options.spaces) {
|
|
79
|
+
spaces = options.spaces
|
|
80
|
+
}
|
|
81
|
+
if (options.EOL) {
|
|
82
|
+
EOL = options.EOL
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var str = JSON.stringify(obj, options ? options.replacer : null, spaces)
|
|
87
|
+
|
|
88
|
+
return str.replace(/\n/g, EOL) + EOL
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function writeFile (file, obj, options, callback) {
|
|
92
|
+
if (callback == null) {
|
|
93
|
+
callback = options
|
|
94
|
+
options = {}
|
|
95
|
+
}
|
|
96
|
+
options = options || {}
|
|
97
|
+
var fs = options.fs || _fs
|
|
98
|
+
|
|
99
|
+
var str = ''
|
|
100
|
+
try {
|
|
101
|
+
str = stringify(obj, options)
|
|
102
|
+
} catch (err) {
|
|
103
|
+
// Need to return whether a callback was passed or not
|
|
104
|
+
if (callback) callback(err, null)
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
fs.writeFile(file, str, options, callback)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function writeFileSync (file, obj, options) {
|
|
112
|
+
options = options || {}
|
|
113
|
+
var fs = options.fs || _fs
|
|
114
|
+
|
|
115
|
+
var str = stringify(obj, options)
|
|
116
|
+
// not sure if fs.writeFileSync returns anything, but just in case
|
|
117
|
+
return fs.writeFileSync(file, str, options)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function stripBom (content) {
|
|
121
|
+
// we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
|
|
122
|
+
if (Buffer.isBuffer(content)) content = content.toString('utf8')
|
|
123
|
+
content = content.replace(/^\uFEFF/, '')
|
|
124
|
+
return content
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var jsonfile = {
|
|
128
|
+
readFile: readFile,
|
|
129
|
+
readFileSync: readFileSync,
|
|
130
|
+
writeFile: writeFile,
|
|
131
|
+
writeFileSync: writeFileSync
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module.exports = jsonfile
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jsonfile",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Easily read/write JSON files.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git@github.com:jprichardson/node-jsonfile.git"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"read",
|
|
11
|
+
"write",
|
|
12
|
+
"file",
|
|
13
|
+
"json",
|
|
14
|
+
"fs",
|
|
15
|
+
"fs-extra"
|
|
16
|
+
],
|
|
17
|
+
"author": "JP Richardson <jprichardson@gmail.com>",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"optionalDependencies": {
|
|
21
|
+
"graceful-fs": "^4.1.6"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"mocha": "2.x",
|
|
25
|
+
"rimraf": "^2.4.0",
|
|
26
|
+
"standard": "^10.0.3"
|
|
27
|
+
},
|
|
28
|
+
"main": "index.js",
|
|
29
|
+
"files": [
|
|
30
|
+
"index.js"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"lint": "standard",
|
|
34
|
+
"test": "npm run lint && npm run unit",
|
|
35
|
+
"unit": "mocha"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
,"_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz"
|
|
39
|
+
,"_integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg=="
|
|
40
|
+
,"_from": "jsonfile@4.0.0"
|
|
41
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
6.0.0 / 2018-09-22
|
|
2
|
+
------------------
|
|
3
|
+
|
|
4
|
+
### Added
|
|
5
|
+
- `traverseAll` option. It would allow to traverse all subdirectories regardless of filter option. [#13] (Thanks to [@jskrzypek](https://github.com/jskrzypek))
|
|
6
|
+
|
|
7
|
+
5.0.0 / 2018-09-05
|
|
8
|
+
------------------
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated the algorithm to handle `depthLimit` option properly. [#12] (Thanks to [@Geelik](https://github.com/Geelik))
|
|
12
|
+
|
|
13
|
+
4.0.0 / 2018-04-30
|
|
14
|
+
------------------
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
- **BREAKING** Removed `noRecurseOnFailedFilter` option because it was counter-intuitive and confusing.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- `fs` option. It is useful when mocking `fs` object.
|
|
21
|
+
- `depthLimit` option. It can be used to specify the number of times to recurse before stopping.
|
|
22
|
+
|
|
23
|
+
3.0.2 / 2017-10-21
|
|
24
|
+
------------------
|
|
25
|
+
|
|
26
|
+
- Use `var` instead of `let` in for loop.
|
|
27
|
+
|
|
28
|
+
3.0.0 / 2017-08-06
|
|
29
|
+
------------------
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- `graceful-fs` is now a regular dependency, and is always loaded. This should speed up `require` time.
|
|
33
|
+
|
|
34
|
+
2.1.0 / 2017-04-25
|
|
35
|
+
------------------
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- Apply `opts.nodir` and `opts.nofile` when `filter` option is used.
|
|
39
|
+
|
|
40
|
+
2.0.0 / 2017-04-23
|
|
41
|
+
------------------
|
|
42
|
+
|
|
43
|
+
### Removed
|
|
44
|
+
- **BREAKING:** Removed support for `ignore` option. Instead, `filter` option can be used. See: [#1]
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- `filter` option. A function that gets one argument `fn({path: '', stats: {}})` and returns true to include or false to exclude the item.
|
|
48
|
+
- `noRecurseOnFailedFilter` option to prevent unnecessary traversal of unwanted directories when `filter` function is used.
|
|
49
|
+
|
|
50
|
+
1.1.2 / 2017-02-17
|
|
51
|
+
------------------
|
|
52
|
+
|
|
53
|
+
- Changed to traditional for loop instead of using `Array.forEach()` because of better performance.
|
|
54
|
+
|
|
55
|
+
1.1.1 / 2017-02-05
|
|
56
|
+
------------------
|
|
57
|
+
|
|
58
|
+
- changed handling error to throw the exception
|
|
59
|
+
|
|
60
|
+
1.1.0 / 2017-01-25
|
|
61
|
+
------------------
|
|
62
|
+
|
|
63
|
+
- switched from [multimatch](https://github.com/sindresorhus/multimatch) to [micromatch](https://github.com/jonschlinkert/micromatch) for matching ignore patterns (showed faster performance)
|
|
64
|
+
- bug fixed: normalize root directory to make sure always return absolute paths.
|
|
65
|
+
|
|
66
|
+
1.0.2 / 2017-01-17
|
|
67
|
+
------------------
|
|
68
|
+
|
|
69
|
+
- initial release
|
|
70
|
+
|
|
71
|
+
[#1]: https://github.com/manidlou/node-klaw-sync/issues/1 "loading all files with certain name"
|
|
72
|
+
[#12]: https://github.com/manidlou/node-klaw-sync/pull/12 "Fixing logic issues"
|
|
73
|
+
[#13]: https://github.com/manidlou/node-klaw-sync/pull/13 "Traverse all option"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT license
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Mani Maghsoudlou
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|