projen 0.91.16 → 0.91.18
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/.jsii +62 -18
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps-py.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-py.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/cdk8s-deps-py.js +1 -1
- package/lib/cdk8s/cdk8s-deps.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose/docker-compose-service.js +1 -1
- package/lib/docker-compose/docker-compose.js +1 -1
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/actions-provider.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/auto-queue.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/merge-queue.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-backport.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow-job.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflow-actions.js +1 -1
- package/lib/github/workflow-jobs.js +1 -1
- package/lib/github/workflow-steps.js +1 -1
- package/lib/github/workflows.d.ts +10 -0
- package/lib/github/workflows.js +4 -2
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +2 -2
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +4 -4
- package/lib/javascript/license-checker.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +2 -2
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/javascript/yarnrc.js +1 -1
- package/lib/json-patch.js +1 -1
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project-tree.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +2 -2
- package/lib/projenrc.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest-sample.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/renovatebot.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc-ts.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +6 -6
- package/lib/version.js +2 -2
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/extensions.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/settings.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/{minimatch/node_modules/brace-expansion → @nodelib/fs.scandir}/LICENSE +2 -2
- package/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +586 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +60 -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 +331 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +122 -0
- package/node_modules/braces/package.json +77 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/execa/index.js +361 -0
- package/node_modules/execa/lib/errname.js +39 -0
- package/node_modules/execa/lib/stdio.js +41 -0
- package/node_modules/execa/license +9 -0
- package/node_modules/execa/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/execa/node_modules/cross-spawn/README.md +94 -0
- package/node_modules/execa/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/parse.js +125 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js +51 -0
- package/node_modules/execa/node_modules/cross-spawn/package.json +75 -0
- package/node_modules/execa/node_modules/semver/README.md +412 -0
- package/node_modules/execa/node_modules/semver/bin/semver +160 -0
- package/node_modules/execa/node_modules/semver/package.json +38 -0
- package/node_modules/execa/node_modules/semver/range.bnf +16 -0
- package/node_modules/execa/node_modules/semver/semver.js +1525 -0
- package/node_modules/execa/node_modules/shebang-command/index.js +19 -0
- package/node_modules/execa/node_modules/shebang-command/license +21 -0
- package/node_modules/execa/node_modules/shebang-command/package.json +39 -0
- package/node_modules/execa/node_modules/shebang-command/readme.md +39 -0
- package/node_modules/execa/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/execa/node_modules/shebang-regex/package.json +32 -0
- package/node_modules/execa/node_modules/shebang-regex/readme.md +29 -0
- package/node_modules/{shelljs/node_modules/glob → execa/node_modules/which}/LICENSE +0 -6
- package/node_modules/execa/node_modules/which/README.md +51 -0
- package/node_modules/execa/node_modules/which/bin/which +52 -0
- package/node_modules/execa/node_modules/which/package.json +30 -0
- package/node_modules/execa/node_modules/which/which.js +135 -0
- package/node_modules/execa/package.json +69 -0
- package/node_modules/execa/readme.md +327 -0
- package/node_modules/fast-glob/LICENSE +21 -0
- package/node_modules/fast-glob/README.md +830 -0
- package/node_modules/fast-glob/node_modules/glob-parent/LICENSE +15 -0
- package/node_modules/fast-glob/node_modules/glob-parent/README.md +137 -0
- package/node_modules/fast-glob/node_modules/glob-parent/index.js +42 -0
- package/node_modules/fast-glob/node_modules/glob-parent/package.json +48 -0
- package/node_modules/fast-glob/out/index.d.ts +40 -0
- package/node_modules/fast-glob/out/index.js +102 -0
- package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/async.js +23 -0
- package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
- package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
- package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/node_modules/fast-glob/out/readers/async.js +35 -0
- package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/node_modules/fast-glob/out/settings.js +59 -0
- package/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/node_modules/fast-glob/out/types/index.js +2 -0
- package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/array.js +22 -0
- package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/node_modules/fast-glob/out/utils/index.js +17 -0
- package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/node_modules/fast-glob/out/utils/path.js +68 -0
- package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
- package/node_modules/fast-glob/out/utils/pattern.js +206 -0
- package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/string.js +11 -0
- package/node_modules/fast-glob/package.json +81 -0
- package/node_modules/fastq/.github/dependabot.yml +11 -0
- package/node_modules/fastq/.github/workflows/ci.yml +75 -0
- package/node_modules/fastq/LICENSE +13 -0
- package/node_modules/fastq/README.md +312 -0
- package/node_modules/fastq/SECURITY.md +15 -0
- package/node_modules/fastq/bench.js +66 -0
- package/node_modules/fastq/example.js +14 -0
- package/node_modules/fastq/example.mjs +11 -0
- package/node_modules/fastq/index.d.ts +57 -0
- package/node_modules/fastq/package.json +53 -0
- package/node_modules/fastq/queue.js +311 -0
- package/node_modules/fastq/test/example.ts +83 -0
- package/node_modules/fastq/test/promise.js +291 -0
- package/node_modules/fastq/test/test.js +653 -0
- package/node_modules/fastq/test/tsconfig.json +11 -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 +248 -0
- package/node_modules/fill-range/package.json +74 -0
- package/node_modules/get-stream/buffer-stream.js +51 -0
- package/node_modules/get-stream/index.js +50 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +46 -0
- package/node_modules/get-stream/readme.md +123 -0
- package/node_modules/is-extglob/LICENSE +21 -0
- package/node_modules/is-extglob/README.md +107 -0
- package/node_modules/is-extglob/index.js +20 -0
- package/node_modules/is-extglob/package.json +69 -0
- package/node_modules/is-glob/LICENSE +21 -0
- package/node_modules/is-glob/README.md +206 -0
- package/node_modules/is-glob/index.js +150 -0
- package/node_modules/is-glob/package.json +81 -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 +82 -0
- package/node_modules/is-stream/index.js +21 -0
- package/node_modules/is-stream/license +21 -0
- package/node_modules/is-stream/package.json +38 -0
- package/node_modules/is-stream/readme.md +42 -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 +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/merge2/LICENSE +21 -0
- package/node_modules/merge2/README.md +144 -0
- package/node_modules/merge2/index.js +144 -0
- package/node_modules/merge2/package.json +43 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1024 -0
- package/node_modules/micromatch/index.js +474 -0
- package/node_modules/micromatch/package.json +119 -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 +33 -0
- package/node_modules/nice-try/src/index.js +12 -0
- package/node_modules/npm-run-path/index.js +39 -0
- package/node_modules/npm-run-path/license +21 -0
- package/node_modules/npm-run-path/package.json +45 -0
- package/node_modules/npm-run-path/readme.md +81 -0
- package/node_modules/p-finally/index.js +15 -0
- package/node_modules/p-finally/license +21 -0
- package/node_modules/p-finally/package.json +42 -0
- package/node_modules/p-finally/readme.md +47 -0
- package/node_modules/path-key/index.js +13 -0
- package/node_modules/path-key/license +21 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +51 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +708 -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 +1091 -0
- package/node_modules/picomatch/lib/picomatch.js +342 -0
- package/node_modules/picomatch/lib/scan.js +391 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +81 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/{concat-map → queue-microtask}/LICENSE +3 -1
- package/node_modules/queue-microtask/README.md +90 -0
- package/node_modules/queue-microtask/index.d.ts +2 -0
- package/node_modules/queue-microtask/index.js +9 -0
- package/node_modules/queue-microtask/package.json +55 -0
- package/node_modules/reusify/.github/dependabot.yml +7 -0
- package/node_modules/reusify/.github/workflows/ci.yml +96 -0
- package/node_modules/reusify/LICENSE +22 -0
- package/node_modules/reusify/README.md +139 -0
- package/node_modules/reusify/SECURITY.md +15 -0
- package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/node_modules/reusify/benchmarks/fib.js +13 -0
- package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/node_modules/reusify/eslint.config.js +14 -0
- package/node_modules/reusify/package.json +50 -0
- package/node_modules/reusify/reusify.d.ts +14 -0
- package/node_modules/reusify/reusify.js +33 -0
- package/node_modules/reusify/test.js +66 -0
- package/node_modules/reusify/tsconfig.json +11 -0
- package/node_modules/run-parallel/LICENSE +20 -0
- package/node_modules/run-parallel/README.md +85 -0
- package/node_modules/run-parallel/index.js +51 -0
- package/node_modules/run-parallel/package.json +58 -0
- package/node_modules/shelljs/LICENSE +23 -20
- package/node_modules/shelljs/README.md +173 -65
- package/node_modules/shelljs/package.json +38 -22
- package/node_modules/shelljs/plugin.js +1 -1
- package/node_modules/shelljs/shell.js +70 -12
- package/node_modules/shelljs/src/cat.js +3 -3
- package/node_modules/shelljs/src/cd.js +2 -1
- package/node_modules/shelljs/src/chmod.js +17 -11
- package/node_modules/shelljs/src/cmd.js +122 -0
- package/node_modules/shelljs/src/common.js +103 -29
- package/node_modules/shelljs/src/cp.js +24 -14
- package/node_modules/shelljs/src/dirs.js +7 -9
- package/node_modules/shelljs/src/echo.js +1 -2
- package/node_modules/shelljs/src/errorCode.js +10 -0
- package/node_modules/shelljs/src/exec-child.js +60 -28
- package/node_modules/shelljs/src/exec.js +39 -10
- package/node_modules/shelljs/src/find.js +8 -3
- package/node_modules/shelljs/src/grep.js +15 -4
- package/node_modules/shelljs/src/head.js +1 -1
- package/node_modules/shelljs/src/ln.js +3 -1
- package/node_modules/shelljs/src/ls.js +29 -15
- package/node_modules/shelljs/src/mkdir.js +13 -11
- package/node_modules/shelljs/src/mv.js +4 -3
- package/node_modules/shelljs/src/pwd.js +1 -1
- package/node_modules/shelljs/src/rm.js +11 -11
- package/node_modules/shelljs/src/sed.js +12 -4
- package/node_modules/shelljs/src/set.js +0 -1
- package/node_modules/shelljs/src/sort.js +3 -2
- package/node_modules/shelljs/src/tail.js +12 -2
- package/node_modules/shelljs/src/test.js +3 -2
- package/node_modules/shelljs/src/to.js +2 -1
- package/node_modules/shelljs/src/toEnd.js +2 -1
- package/node_modules/shelljs/src/touch.js +13 -7
- package/node_modules/shelljs/src/uniq.js +5 -4
- package/node_modules/shelljs/src/which.js +5 -4
- package/node_modules/shx/README.md +27 -15
- package/node_modules/shx/lib/help.js +1 -1
- package/node_modules/shx/lib/shx.js +13 -8
- package/node_modules/shx/package.json +17 -25
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/strip-eof/index.js +15 -0
- package/node_modules/strip-eof/license +21 -0
- package/node_modules/strip-eof/package.json +39 -0
- package/node_modules/strip-eof/readme.md +28 -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 +88 -0
- package/package.json +2 -2
- package/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/concat-map/index.js +0 -13
- package/node_modules/concat-map/package.json +0 -43
- package/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/minimatch/README.md +0 -230
- package/node_modules/minimatch/minimatch.js +0 -947
- package/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- package/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- package/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- package/node_modules/minimatch/package.json +0 -33
- package/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/path-is-absolute/package.json +0 -43
- package/node_modules/path-is-absolute/readme.md +0 -59
- package/node_modules/shelljs/commands.js +0 -29
- package/node_modules/shelljs/node_modules/glob/README.md +0 -378
- package/node_modules/shelljs/node_modules/glob/common.js +0 -238
- package/node_modules/shelljs/node_modules/glob/glob.js +0 -790
- package/node_modules/shelljs/node_modules/glob/package.json +0 -55
- package/node_modules/shelljs/node_modules/glob/sync.js +0 -486
- /package/node_modules/{minimatch → execa/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{path-is-absolute → execa/node_modules/shebang-regex}/license +0 -0
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# ShellJS - Unix shell commands for Node.js
|
|
2
2
|
|
|
3
|
-
[](https://ci.appveyor.com/project/shelljs/shelljs/branch/master)
|
|
3
|
+
[](https://github.com/shelljs/shelljs/actions/workflows/main.yml)
|
|
5
4
|
[](https://codecov.io/gh/shelljs/shelljs)
|
|
6
5
|
[](https://www.npmjs.com/package/shelljs)
|
|
7
6
|
[](https://www.npmjs.com/package/shelljs)
|
|
8
7
|
|
|
9
|
-
ShellJS is a portable **(Windows/Linux/
|
|
8
|
+
ShellJS is a portable **(Windows/Linux/macOS)** implementation of Unix shell
|
|
10
9
|
commands on top of the Node.js API. You can use it to eliminate your shell
|
|
11
10
|
script's dependency on Unix while still keeping its familiar and powerful
|
|
12
11
|
commands. You can also install it globally so you can run it from outside Node
|
|
13
12
|
projects - say goodbye to those gnarly Bash scripts!
|
|
14
13
|
|
|
15
|
-
ShellJS is proudly tested on every node release since
|
|
14
|
+
ShellJS is proudly tested on every LTS node release since <!-- start minVersion -->`v18`<!-- stop minVersion -->!
|
|
16
15
|
|
|
17
|
-
The project is
|
|
16
|
+
The project is unit-tested and battle-tested in projects like:
|
|
18
17
|
|
|
19
18
|
+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger
|
|
20
19
|
+ [JSHint](http://jshint.com) & [ESLint](http://eslint.org/) - popular JavaScript linters
|
|
@@ -58,8 +57,7 @@ wiki](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins).
|
|
|
58
57
|
For documentation on all the latest features, check out our
|
|
59
58
|
[README](https://github.com/shelljs/shelljs). To read docs that are consistent
|
|
60
59
|
with the latest release, check out [the npm
|
|
61
|
-
page](https://www.npmjs.com/package/shelljs)
|
|
62
|
-
[shelljs.org](http://documentup.com/shelljs/shelljs).
|
|
60
|
+
page](https://www.npmjs.com/package/shelljs).
|
|
63
61
|
|
|
64
62
|
## Installing
|
|
65
63
|
|
|
@@ -122,6 +120,13 @@ var shell = require('shelljs');
|
|
|
122
120
|
shell.echo('hello world');
|
|
123
121
|
```
|
|
124
122
|
|
|
123
|
+
Alternatively, we also support importing as a module with:
|
|
124
|
+
|
|
125
|
+
```javascript
|
|
126
|
+
import shell from 'shelljs';
|
|
127
|
+
shell.echo('hello world');
|
|
128
|
+
```
|
|
129
|
+
|
|
125
130
|
<!-- DO NOT MODIFY BEYOND THIS POINT - IT'S AUTOMATICALLY GENERATED -->
|
|
126
131
|
|
|
127
132
|
|
|
@@ -130,7 +135,7 @@ shell.echo('hello world');
|
|
|
130
135
|
|
|
131
136
|
All commands run synchronously, unless otherwise stated.
|
|
132
137
|
All commands accept standard bash globbing characters (`*`, `?`, etc.),
|
|
133
|
-
compatible with
|
|
138
|
+
compatible with [`fast-glob`](https://www.npmjs.com/package/fast-glob).
|
|
134
139
|
|
|
135
140
|
For less-commonly used commands and features, please check out our [wiki
|
|
136
141
|
page](https://github.com/shelljs/shelljs/wiki).
|
|
@@ -151,15 +156,16 @@ var str = cat('file1', 'file2');
|
|
|
151
156
|
var str = cat(['file1', 'file2']); // same as above
|
|
152
157
|
```
|
|
153
158
|
|
|
154
|
-
Returns a
|
|
155
|
-
containing the files if more than one file is given (a
|
|
156
|
-
introduced between each file).
|
|
159
|
+
Returns a [ShellString](#shellstringstr) containing the given file, or a
|
|
160
|
+
concatenated string containing the files if more than one file is given (a
|
|
161
|
+
new line character is introduced between each file).
|
|
157
162
|
|
|
158
163
|
|
|
159
164
|
### cd([dir])
|
|
160
165
|
|
|
161
166
|
Changes to directory `dir` for the duration of the script. Changes to home
|
|
162
|
-
directory if no argument is supplied.
|
|
167
|
+
directory if no argument is supplied. Returns a
|
|
168
|
+
[ShellString](#shellstringstr) to indicate success or failure.
|
|
163
169
|
|
|
164
170
|
|
|
165
171
|
### chmod([options,] octal_mode || octal_string, file)
|
|
@@ -188,6 +194,47 @@ Notable exceptions:
|
|
|
188
194
|
+ In symbolic modes, `a-r` and `-r` are identical. No consideration is
|
|
189
195
|
given to the `umask`.
|
|
190
196
|
+ There is no "quiet" option, since default behavior is to run silent.
|
|
197
|
+
+ Windows OS uses a very different permission model than POSIX. `chmod()`
|
|
198
|
+
does its best on Windows, but there are limits to how file permissions can
|
|
199
|
+
be set. Note that WSL (Windows subsystem for Linux) **does** follow POSIX,
|
|
200
|
+
so cross-platform compatibility should not be a concern there.
|
|
201
|
+
|
|
202
|
+
Returns a [ShellString](#shellstringstr) indicating success or failure.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
### cmd(arg1[, arg2, ...] [, options])
|
|
206
|
+
|
|
207
|
+
Available options:
|
|
208
|
+
|
|
209
|
+
+ `cwd: directoryPath`: change the current working directory only for this
|
|
210
|
+
cmd() invocation.
|
|
211
|
+
+ `maxBuffer: num`: Raise or decrease the default buffer size for
|
|
212
|
+
stdout/stderr.
|
|
213
|
+
+ `timeout`: Change the default timeout.
|
|
214
|
+
|
|
215
|
+
Examples:
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
var version = cmd('node', '--version').stdout;
|
|
219
|
+
cmd('git', 'commit', '-am', `Add suport for node ${version}`);
|
|
220
|
+
console.log(cmd('echo', '1st arg', '2nd arg', '3rd arg').stdout)
|
|
221
|
+
console.log(cmd('echo', 'this handles ;, |, &, etc. as literal characters').stdout)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Executes the given command synchronously. This is intended as an easier
|
|
225
|
+
alternative for [exec()](#execcommand--options--callback), with better
|
|
226
|
+
security around globbing, comamnd injection, and variable expansion. This is
|
|
227
|
+
guaranteed to only run one external command, and won't give special
|
|
228
|
+
treatment for any shell characters (ex. this treats `|` as a literal
|
|
229
|
+
character, not as a shell pipeline).
|
|
230
|
+
This returns a [ShellString](#shellstringstr).
|
|
231
|
+
|
|
232
|
+
By default, this performs globbing on all platforms, but you can disable
|
|
233
|
+
this with `set('-f')`.
|
|
234
|
+
|
|
235
|
+
This **does not** support asynchronous mode. If you need asynchronous
|
|
236
|
+
command execution, check out [execa](https://www.npmjs.com/package/execa) or
|
|
237
|
+
the node builtin `child_process.execFile()` instead.
|
|
191
238
|
|
|
192
239
|
|
|
193
240
|
### cp([options,] source [, source ...], dest)
|
|
@@ -201,6 +248,7 @@ Available options:
|
|
|
201
248
|
+ `-r`, `-R`: recursive
|
|
202
249
|
+ `-L`: follow symlinks
|
|
203
250
|
+ `-P`: don't follow symlinks
|
|
251
|
+
+ `-p`: preserve file mode, ownership, and timestamps
|
|
204
252
|
|
|
205
253
|
Examples:
|
|
206
254
|
|
|
@@ -211,7 +259,8 @@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');
|
|
|
211
259
|
cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above
|
|
212
260
|
```
|
|
213
261
|
|
|
214
|
-
Copies files.
|
|
262
|
+
Copies files. Returns a [ShellString](#shellstringstr) indicating success
|
|
263
|
+
or failure.
|
|
215
264
|
|
|
216
265
|
|
|
217
266
|
### pushd([options,] [dir | '-N' | '+N'])
|
|
@@ -219,7 +268,7 @@ Copies files.
|
|
|
219
268
|
Available options:
|
|
220
269
|
|
|
221
270
|
+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.
|
|
222
|
-
+ `-q`:
|
|
271
|
+
+ `-q`: Suppresses output to the console.
|
|
223
272
|
|
|
224
273
|
Arguments:
|
|
225
274
|
|
|
@@ -243,7 +292,7 @@ Save the current directory on the top of the directory stack and then `cd` to `d
|
|
|
243
292
|
Available options:
|
|
244
293
|
|
|
245
294
|
+ `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated.
|
|
246
|
-
+ `-q`:
|
|
295
|
+
+ `-q`: Suppresses output to the console.
|
|
247
296
|
|
|
248
297
|
Arguments:
|
|
249
298
|
|
|
@@ -268,7 +317,7 @@ When no arguments are given, `popd` removes the top directory from the stack and
|
|
|
268
317
|
Available options:
|
|
269
318
|
|
|
270
319
|
+ `-c`: Clears the directory stack by deleting all of the elements.
|
|
271
|
-
+ `-q`:
|
|
320
|
+
+ `-q`: Suppresses output to the console.
|
|
272
321
|
|
|
273
322
|
Arguments:
|
|
274
323
|
|
|
@@ -295,8 +344,7 @@ var str = echo('hello world');
|
|
|
295
344
|
echo('-n', 'no newline at end');
|
|
296
345
|
```
|
|
297
346
|
|
|
298
|
-
Prints `string` to stdout, and returns
|
|
299
|
-
like `.to()`.
|
|
347
|
+
Prints `string` to stdout, and returns a [ShellString](#shellstringstr).
|
|
300
348
|
|
|
301
349
|
|
|
302
350
|
### exec(command [, options] [, callback])
|
|
@@ -305,6 +353,7 @@ Available options:
|
|
|
305
353
|
|
|
306
354
|
+ `async`: Asynchronous execution. If a callback is provided, it will be set to
|
|
307
355
|
`true`, regardless of the passed value (default: `false`).
|
|
356
|
+
+ `fatal`: Exit upon error (default: `false`).
|
|
308
357
|
+ `silent`: Do not echo program output to console (default: `false`).
|
|
309
358
|
+ `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and
|
|
310
359
|
what is written to stdout and stderr when not in silent mode (default: `'utf8'`).
|
|
@@ -328,15 +377,20 @@ exec('some_long_running_process', function(code, stdout, stderr) {
|
|
|
328
377
|
});
|
|
329
378
|
```
|
|
330
379
|
|
|
331
|
-
Executes the given `command` _synchronously_, unless otherwise specified.
|
|
332
|
-
mode, this returns a
|
|
333
|
-
|
|
334
|
-
|
|
380
|
+
Executes the given `command` _synchronously_, unless otherwise specified.
|
|
381
|
+
When in synchronous mode, this returns a [ShellString](#shellstringstr).
|
|
382
|
+
Otherwise, this returns the child process object, and the `callback`
|
|
383
|
+
receives the arguments `(code, stdout, stderr)`.
|
|
335
384
|
|
|
336
385
|
Not seeing the behavior you want? `exec()` runs everything through `sh`
|
|
337
386
|
by default (or `cmd.exe` on Windows), which differs from `bash`. If you
|
|
338
387
|
need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option.
|
|
339
388
|
|
|
389
|
+
**Security note:** as `shell.exec()` executes an arbitrary string in the
|
|
390
|
+
system shell, it is **critical** to properly sanitize user input to avoid
|
|
391
|
+
**command injection**. For more context, consult the [Security
|
|
392
|
+
Guidelines](https://github.com/shelljs/shelljs/wiki/Security-guidelines).
|
|
393
|
+
|
|
340
394
|
|
|
341
395
|
### find(path [, path ...])
|
|
342
396
|
### find(path_array)
|
|
@@ -349,7 +403,8 @@ find(['src', 'lib']); // same as above
|
|
|
349
403
|
find('.').filter(function(file) { return file.match(/\.js$/); });
|
|
350
404
|
```
|
|
351
405
|
|
|
352
|
-
Returns
|
|
406
|
+
Returns a [ShellString](#shellstringstr) (with array-like properties) of all
|
|
407
|
+
files (however deep) in the given paths.
|
|
353
408
|
|
|
354
409
|
The main difference from `ls('-R', path)` is that the resulting file names
|
|
355
410
|
include the base directories (e.g., `lib/resources/file1` instead of just `file1`).
|
|
@@ -363,6 +418,7 @@ Available options:
|
|
|
363
418
|
+ `-v`: Invert `regex_filter` (only print non-matching lines).
|
|
364
419
|
+ `-l`: Print only filenames of matching files.
|
|
365
420
|
+ `-i`: Ignore case.
|
|
421
|
+
+ `-n`: Print line numbers.
|
|
366
422
|
|
|
367
423
|
Examples:
|
|
368
424
|
|
|
@@ -371,8 +427,9 @@ grep('-v', 'GLOBAL_VARIABLE', '*.js');
|
|
|
371
427
|
grep('GLOBAL_VARIABLE', '*.js');
|
|
372
428
|
```
|
|
373
429
|
|
|
374
|
-
Reads input string from given files and returns a
|
|
375
|
-
|
|
430
|
+
Reads input string from given files and returns a
|
|
431
|
+
[ShellString](#shellstringstr) containing all lines of the @ file that match
|
|
432
|
+
the given `regex_filter`.
|
|
376
433
|
|
|
377
434
|
|
|
378
435
|
### head([{'-n': \<num\>},] file [, file ...])
|
|
@@ -390,7 +447,7 @@ var str = head('file1', 'file2');
|
|
|
390
447
|
var str = head(['file1', 'file2']); // same as above
|
|
391
448
|
```
|
|
392
449
|
|
|
393
|
-
Read the start of a file.
|
|
450
|
+
Read the start of a `file`. Returns a [ShellString](#shellstringstr).
|
|
394
451
|
|
|
395
452
|
|
|
396
453
|
### ln([options,] source, dest)
|
|
@@ -407,7 +464,9 @@ ln('file', 'newlink');
|
|
|
407
464
|
ln('-sf', 'file', 'existing');
|
|
408
465
|
```
|
|
409
466
|
|
|
410
|
-
Links `source` to `dest`. Use `-f` to force the link, should `dest` already
|
|
467
|
+
Links `source` to `dest`. Use `-f` to force the link, should `dest` already
|
|
468
|
+
exist. Returns a [ShellString](#shellstringstr) indicating success or
|
|
469
|
+
failure.
|
|
411
470
|
|
|
412
471
|
|
|
413
472
|
### ls([options,] [path, ...])
|
|
@@ -419,22 +478,28 @@ Available options:
|
|
|
419
478
|
+ `-A`: all files (include files beginning with `.`, except for `.` and `..`)
|
|
420
479
|
+ `-L`: follow symlinks
|
|
421
480
|
+ `-d`: list directories themselves, not their contents
|
|
422
|
-
+ `-l`:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
481
|
+
+ `-l`: provides more details for each file. Specifically, each file is
|
|
482
|
+
represented by a structured object with separate fields for file
|
|
483
|
+
metadata (see
|
|
484
|
+
[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)). The
|
|
485
|
+
return value also overrides `.toString()` to resemble `ls -l`'s
|
|
486
|
+
output format for human readability, but programmatic usage should
|
|
487
|
+
depend on the stable object format rather than the `.toString()`
|
|
488
|
+
representation.
|
|
426
489
|
|
|
427
490
|
Examples:
|
|
428
491
|
|
|
429
492
|
```javascript
|
|
430
493
|
ls('projs/*.js');
|
|
494
|
+
ls('projs/**/*.js'); // Find all js files recursively in projs
|
|
431
495
|
ls('-R', '/users/me', '/tmp');
|
|
432
496
|
ls('-R', ['/users/me', '/tmp']); // same as above
|
|
433
497
|
ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...}
|
|
434
498
|
```
|
|
435
499
|
|
|
436
|
-
Returns
|
|
437
|
-
the current directory if no
|
|
500
|
+
Returns a [ShellString](#shellstringstr) (with array-like properties) of all
|
|
501
|
+
the files in the given `path`, or files in the current directory if no
|
|
502
|
+
`path` is provided.
|
|
438
503
|
|
|
439
504
|
|
|
440
505
|
### mkdir([options,] dir [, dir ...])
|
|
@@ -451,7 +516,8 @@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');
|
|
|
451
516
|
mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above
|
|
452
517
|
```
|
|
453
518
|
|
|
454
|
-
Creates directories.
|
|
519
|
+
Creates directories. Returns a [ShellString](#shellstringstr) indicating
|
|
520
|
+
success or failure.
|
|
455
521
|
|
|
456
522
|
|
|
457
523
|
### mv([options ,] source [, source ...], dest')
|
|
@@ -470,12 +536,13 @@ mv('file1', 'file2', 'dir/');
|
|
|
470
536
|
mv(['file1', 'file2'], 'dir/'); // same as above
|
|
471
537
|
```
|
|
472
538
|
|
|
473
|
-
Moves `source` file(s) to `dest`.
|
|
539
|
+
Moves `source` file(s) to `dest`. Returns a [ShellString](#shellstringstr)
|
|
540
|
+
indicating success or failure.
|
|
474
541
|
|
|
475
542
|
|
|
476
543
|
### pwd()
|
|
477
544
|
|
|
478
|
-
Returns the current directory.
|
|
545
|
+
Returns the current directory as a [ShellString](#shellstringstr).
|
|
479
546
|
|
|
480
547
|
|
|
481
548
|
### rm([options,] file [, file ...])
|
|
@@ -494,7 +561,8 @@ rm('some_file.txt', 'another_file.txt');
|
|
|
494
561
|
rm(['some_file.txt', 'another_file.txt']); // same as above
|
|
495
562
|
```
|
|
496
563
|
|
|
497
|
-
Removes files.
|
|
564
|
+
Removes files. Returns a [ShellString](#shellstringstr) indicating success
|
|
565
|
+
or failure.
|
|
498
566
|
|
|
499
567
|
|
|
500
568
|
### sed([options,] search_regex, replacement, file [, file ...])
|
|
@@ -508,11 +576,11 @@ Examples:
|
|
|
508
576
|
|
|
509
577
|
```javascript
|
|
510
578
|
sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
|
|
511
|
-
sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
|
|
512
579
|
```
|
|
513
580
|
|
|
514
|
-
Reads an input string from `file`s, and performs a JavaScript `replace()` on
|
|
515
|
-
using the given `search_regex` and `replacement` string or
|
|
581
|
+
Reads an input string from `file`s, line by line, and performs a JavaScript `replace()` on
|
|
582
|
+
each of the lines from the input string using the given `search_regex` and `replacement` string or
|
|
583
|
+
function. Returns the new [ShellString](#shellstringstr) after replacement.
|
|
516
584
|
|
|
517
585
|
Note:
|
|
518
586
|
|
|
@@ -523,6 +591,10 @@ using the `$n` syntax:
|
|
|
523
591
|
sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt');
|
|
524
592
|
```
|
|
525
593
|
|
|
594
|
+
Also, like unix `sed`, ShellJS `sed` runs replacements on each line from the input file
|
|
595
|
+
(split by '\n') separately, so `search_regex`es that span more than one line (or include '\n')
|
|
596
|
+
will not match anything and nothing will be replaced.
|
|
597
|
+
|
|
526
598
|
|
|
527
599
|
### set(options)
|
|
528
600
|
|
|
@@ -557,8 +629,9 @@ sort('foo.txt', 'bar.txt');
|
|
|
557
629
|
sort('-r', 'foo.txt');
|
|
558
630
|
```
|
|
559
631
|
|
|
560
|
-
Return the contents of the `file`s, sorted line-by-line
|
|
561
|
-
files mixes their content
|
|
632
|
+
Return the contents of the `file`s, sorted line-by-line as a
|
|
633
|
+
[ShellString](#shellstringstr). Sorting multiple files mixes their content
|
|
634
|
+
(just as unix `sort` does).
|
|
562
635
|
|
|
563
636
|
|
|
564
637
|
### tail([{'-n': \<num\>},] file [, file ...])
|
|
@@ -576,7 +649,7 @@ var str = tail('file1', 'file2');
|
|
|
576
649
|
var str = tail(['file1', 'file2']); // same as above
|
|
577
650
|
```
|
|
578
651
|
|
|
579
|
-
Read the end of a `file`.
|
|
652
|
+
Read the end of a `file`. Returns a [ShellString](#shellstringstr).
|
|
580
653
|
|
|
581
654
|
|
|
582
655
|
### tempdir()
|
|
@@ -608,10 +681,11 @@ Examples:
|
|
|
608
681
|
|
|
609
682
|
```javascript
|
|
610
683
|
if (test('-d', path)) { /* do something with dir */ };
|
|
611
|
-
if (!test('-f', path)) continue; // skip if it's a regular file
|
|
684
|
+
if (!test('-f', path)) continue; // skip if it's not a regular file
|
|
612
685
|
```
|
|
613
686
|
|
|
614
|
-
Evaluates `expression` using the available primaries and returns
|
|
687
|
+
Evaluates `expression` using the available primaries and returns
|
|
688
|
+
corresponding boolean value.
|
|
615
689
|
|
|
616
690
|
|
|
617
691
|
### ShellString.prototype.to(file)
|
|
@@ -624,7 +698,8 @@ cat('input.txt').to('output.txt');
|
|
|
624
698
|
|
|
625
699
|
Analogous to the redirection operator `>` in Unix, but works with
|
|
626
700
|
`ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix
|
|
627
|
-
redirections, `to()` will overwrite any existing file!_
|
|
701
|
+
redirections, `to()` will overwrite any existing file!_ Returns the same
|
|
702
|
+
[ShellString](#shellstringstr) this operated on, to support chaining.
|
|
628
703
|
|
|
629
704
|
|
|
630
705
|
### ShellString.prototype.toEnd(file)
|
|
@@ -636,7 +711,8 @@ cat('input.txt').toEnd('output.txt');
|
|
|
636
711
|
```
|
|
637
712
|
|
|
638
713
|
Analogous to the redirect-and-append operator `>>` in Unix, but works with
|
|
639
|
-
`ShellStrings` (such as those returned by `cat`, `grep`, etc.).
|
|
714
|
+
`ShellStrings` (such as those returned by `cat`, `grep`, etc.). Returns the
|
|
715
|
+
same [ShellString](#shellstringstr) this operated on, to support chaining.
|
|
640
716
|
|
|
641
717
|
|
|
642
718
|
### touch([options,] file [, file ...])
|
|
@@ -647,20 +723,26 @@ Available options:
|
|
|
647
723
|
+ `-a`: Change only the access time
|
|
648
724
|
+ `-c`: Do not create any files
|
|
649
725
|
+ `-m`: Change only the modification time
|
|
650
|
-
+
|
|
651
|
-
|
|
726
|
+
+ `{'-d': someDate}`, `{date: someDate}`: Use a `Date` instance (ex. `someDate`)
|
|
727
|
+
instead of current time
|
|
728
|
+
+ `{'-r': file}`, `{reference: file}`: Use `file`'s times instead of current
|
|
729
|
+
time
|
|
652
730
|
|
|
653
731
|
Examples:
|
|
654
732
|
|
|
655
733
|
```javascript
|
|
656
734
|
touch('source.js');
|
|
657
|
-
touch('-c', '
|
|
658
|
-
touch({ '-r':
|
|
735
|
+
touch('-c', 'path/to/file.js');
|
|
736
|
+
touch({ '-r': 'referenceFile.txt' }, 'path/to/file.js');
|
|
737
|
+
touch({ '-d': new Date('December 17, 1995 03:24:00'), '-m': true }, 'path/to/file.js');
|
|
738
|
+
touch({ date: new Date('December 17, 1995 03:24:00') }, 'path/to/file.js');
|
|
659
739
|
```
|
|
660
740
|
|
|
661
|
-
Update the access and modification times of each
|
|
662
|
-
A
|
|
663
|
-
This is a partial implementation of
|
|
741
|
+
Update the access and modification times of each file to the current time.
|
|
742
|
+
A file argument that does not exist is created empty, unless `-c` is supplied.
|
|
743
|
+
This is a partial implementation of
|
|
744
|
+
[`touch(1)`](http://linux.die.net/man/1/touch). Returns a
|
|
745
|
+
[ShellString](#shellstringstr) indicating success or failure.
|
|
664
746
|
|
|
665
747
|
|
|
666
748
|
### uniq([options,] [input, [output]])
|
|
@@ -679,7 +761,8 @@ uniq('-i', 'foo.txt');
|
|
|
679
761
|
uniq('-cd', 'foo.txt', 'bar.txt');
|
|
680
762
|
```
|
|
681
763
|
|
|
682
|
-
Filter adjacent matching lines from `input`.
|
|
764
|
+
Filter adjacent matching lines from `input`. Returns a
|
|
765
|
+
[ShellString](#shellstringstr).
|
|
683
766
|
|
|
684
767
|
|
|
685
768
|
### which(command)
|
|
@@ -692,7 +775,8 @@ var nodeExec = which('node');
|
|
|
692
775
|
|
|
693
776
|
Searches for `command` in the system's `PATH`. On Windows, this uses the
|
|
694
777
|
`PATHEXT` variable to append the extension if it's not already executable.
|
|
695
|
-
Returns
|
|
778
|
+
Returns a [ShellString](#shellstringstr) containing the absolute path to
|
|
779
|
+
`command`.
|
|
696
780
|
|
|
697
781
|
|
|
698
782
|
### exit(code)
|
|
@@ -709,16 +793,29 @@ return value to be an error message. If you need the last error message, use
|
|
|
709
793
|
the `.stderr` attribute from the last command's return value instead.
|
|
710
794
|
|
|
711
795
|
|
|
796
|
+
### errorCode()
|
|
797
|
+
|
|
798
|
+
Returns the error code from the last command.
|
|
799
|
+
|
|
800
|
+
|
|
712
801
|
### ShellString(str)
|
|
713
802
|
|
|
714
803
|
Examples:
|
|
715
804
|
|
|
716
805
|
```javascript
|
|
717
|
-
var foo = ShellString('hello world');
|
|
806
|
+
var foo = new ShellString('hello world');
|
|
718
807
|
```
|
|
719
808
|
|
|
720
|
-
|
|
721
|
-
|
|
809
|
+
This is a dedicated type returned by most ShellJS methods, which wraps a
|
|
810
|
+
string (or array) value. This has all the string (or array) methods, but
|
|
811
|
+
also exposes extra methods: [`.to()`](#shellstringprototypetofile),
|
|
812
|
+
[`.toEnd()`](#shellstringprototypetoendfile), and all the pipe-able methods
|
|
813
|
+
(ex. `.cat()`, `.grep()`, etc.). This can be easily converted into a string
|
|
814
|
+
by calling `.toString()`.
|
|
815
|
+
|
|
816
|
+
This type also exposes the corresponding command's stdout, stderr, and
|
|
817
|
+
return status code via the `.stdout` (string), `.stderr` (string), and
|
|
818
|
+
`.code` (number) properties respectively.
|
|
722
819
|
|
|
723
820
|
|
|
724
821
|
### env['VAR_NAME']
|
|
@@ -732,7 +829,7 @@ Examples:
|
|
|
732
829
|
|
|
733
830
|
```javascript
|
|
734
831
|
grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt');
|
|
735
|
-
echo(
|
|
832
|
+
echo("files with o's in the name:\n" + ls().grep('o'));
|
|
736
833
|
cat('test.js').exec('node'); // pipe to exec() call
|
|
737
834
|
```
|
|
738
835
|
|
|
@@ -792,7 +889,14 @@ rm -rf foo.txt bar.txt
|
|
|
792
889
|
exec echo hello
|
|
793
890
|
```
|
|
794
891
|
|
|
795
|
-
### config.globOptions
|
|
892
|
+
### config.globOptions (deprecated)
|
|
893
|
+
|
|
894
|
+
**Deprecated**: we recommend that you do not edit `config.globOptions`.
|
|
895
|
+
Support for this configuration option may be changed or removed in a future
|
|
896
|
+
ShellJS release.
|
|
897
|
+
|
|
898
|
+
**Breaking change**: ShellJS v0.8.x uses `node-glob`. Starting with ShellJS
|
|
899
|
+
v0.9.x, `config.globOptions` is compatible with `fast-glob`.
|
|
796
900
|
|
|
797
901
|
Example:
|
|
798
902
|
|
|
@@ -800,7 +904,11 @@ Example:
|
|
|
800
904
|
config.globOptions = {nodir: true};
|
|
801
905
|
```
|
|
802
906
|
|
|
803
|
-
|
|
907
|
+
`config.globOptions` changes how ShellJS expands glob (wildcard)
|
|
908
|
+
expressions. See
|
|
909
|
+
[fast-glob](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#options-3)
|
|
910
|
+
for available options. Be aware that modifying `config.globOptions` **may
|
|
911
|
+
break ShellJS functionality.**
|
|
804
912
|
|
|
805
913
|
### config.reset()
|
|
806
914
|
|
|
@@ -830,6 +938,6 @@ Reset `shell.config` to the defaults:
|
|
|
830
938
|
|
|
831
939
|
## Team
|
|
832
940
|
|
|
833
|
-
| [](https://github.com/nfischer) |
|
|
834
|
-
|
|
835
|
-
| [Nate Fischer](https://github.com/nfischer) |
|
|
941
|
+
| [](https://github.com/nfischer) |
|
|
942
|
+
|:---:|
|
|
943
|
+
| [Nate Fischer](https://github.com/nfischer) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shelljs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Portable Unix shell commands for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shelljs",
|
|
@@ -23,8 +23,18 @@
|
|
|
23
23
|
"license": "BSD-3-Clause",
|
|
24
24
|
"homepage": "http://github.com/shelljs/shelljs",
|
|
25
25
|
"main": "./shell.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./shell.js",
|
|
28
|
+
"./global": "./global.js",
|
|
29
|
+
"./global.js": "./global.js",
|
|
30
|
+
"./make": "./make.js",
|
|
31
|
+
"./make.js": "./make.js",
|
|
32
|
+
"./package": "./package.json",
|
|
33
|
+
"./package.json": "./package.json",
|
|
34
|
+
"./plugin": "./plugin.js",
|
|
35
|
+
"./plugin.js": "./plugin.js"
|
|
36
|
+
},
|
|
26
37
|
"files": [
|
|
27
|
-
"commands.js",
|
|
28
38
|
"global.js",
|
|
29
39
|
"make.js",
|
|
30
40
|
"plugin.js",
|
|
@@ -33,15 +43,14 @@
|
|
|
33
43
|
"src"
|
|
34
44
|
],
|
|
35
45
|
"scripts": {
|
|
36
|
-
"
|
|
46
|
+
"check-node-support": "node scripts/check-node-support",
|
|
37
47
|
"posttest": "npm run lint",
|
|
38
|
-
"test": "
|
|
39
|
-
"test-
|
|
48
|
+
"test": "ava",
|
|
49
|
+
"test-with-coverage": "nyc --reporter=text --reporter=lcov ava",
|
|
40
50
|
"gendocs": "node scripts/generate-docs",
|
|
41
51
|
"lint": "eslint .",
|
|
42
52
|
"after-travis": "travis-check-changes",
|
|
43
53
|
"changelog": "shelljs-changelog",
|
|
44
|
-
"codecov": "codecov",
|
|
45
54
|
"release:major": "shelljs-release major",
|
|
46
55
|
"release:minor": "shelljs-release minor",
|
|
47
56
|
"release:patch": "shelljs-release patch"
|
|
@@ -50,30 +59,37 @@
|
|
|
50
59
|
"shjs": "./bin/shjs"
|
|
51
60
|
},
|
|
52
61
|
"dependencies": {
|
|
53
|
-
"
|
|
62
|
+
"execa": "^1.0.0",
|
|
63
|
+
"fast-glob": "^3.3.2",
|
|
54
64
|
"interpret": "^1.0.0",
|
|
55
65
|
"rechoir": "^0.6.2"
|
|
56
66
|
},
|
|
57
67
|
"ava": {
|
|
58
68
|
"serial": true,
|
|
59
|
-
"powerAssert": false
|
|
69
|
+
"powerAssert": false,
|
|
70
|
+
"files": [
|
|
71
|
+
"test/*.js"
|
|
72
|
+
],
|
|
73
|
+
"helpers": [
|
|
74
|
+
"test/resources/**",
|
|
75
|
+
"test/utils/**"
|
|
76
|
+
]
|
|
60
77
|
},
|
|
61
78
|
"devDependencies": {
|
|
62
|
-
"ava": "^
|
|
63
|
-
"chalk": "^
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"eslint": "^
|
|
67
|
-
"eslint-
|
|
68
|
-
"
|
|
69
|
-
"nyc": "^
|
|
70
|
-
"shelljs-changelog": "^0.2.
|
|
71
|
-
"shelljs-release": "^0.
|
|
72
|
-
"shx": "^0.
|
|
73
|
-
"travis-check-changes": "^0.
|
|
79
|
+
"ava": "^2.4.0",
|
|
80
|
+
"chalk": "^4.1.2",
|
|
81
|
+
"coffee-script": "^1.12.7",
|
|
82
|
+
"eslint": "^8.2.0",
|
|
83
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
84
|
+
"eslint-plugin-import": "^2.31.0",
|
|
85
|
+
"js-yaml": "^4.1.0",
|
|
86
|
+
"nyc": "^17.1.0",
|
|
87
|
+
"shelljs-changelog": "^0.2.6",
|
|
88
|
+
"shelljs-release": "^0.5.2",
|
|
89
|
+
"shx": "^0.3.4",
|
|
90
|
+
"travis-check-changes": "^0.4.0"
|
|
74
91
|
},
|
|
75
|
-
"optionalDependencies": {},
|
|
76
92
|
"engines": {
|
|
77
|
-
"node": ">=
|
|
93
|
+
"node": ">=18"
|
|
78
94
|
}
|
|
79
95
|
}
|