pax_global_header00006660000000000000000000000064134200542510014506gustar00rootroot0000000000000052 comment=b675d471022dc772bed516802b5a3b8a6c54e3a1 node-shelljs-0.8.3/000077500000000000000000000000001342005425100141055ustar00rootroot00000000000000node-shelljs-0.8.3/.documentup.json000066400000000000000000000000661342005425100172430ustar00rootroot00000000000000{ "name": "ShellJS", "twitter": [ "r2r" ] } node-shelljs-0.8.3/.editorconfig000066400000000000000000000003331342005425100165610ustar00rootroot00000000000000# editorconfig.org root = true [*] charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true [*.{md,markdown}] trim_trailing_whitespace = false node-shelljs-0.8.3/.eslintignore000066400000000000000000000001071342005425100166060ustar00rootroot00000000000000.nyc_output/ coverage/ make.js node_modules/ test/resources/ test/tmp/ node-shelljs-0.8.3/.eslintrc.json000066400000000000000000000016601342005425100167040ustar00rootroot00000000000000{ "env": { "node": true }, "extends": "airbnb-base/legacy", "rules": { "comma-dangle": ["error", "always-multiline"], "global-require": "off", "vars-on-top": "off", "spaced-comment": ["error", "always", { "markers": ["@", "@include"], "exceptions": ["@", "@commands"] }], "no-param-reassign": "off", "no-console": "off", "curly": ["error", "multi-line"], "func-names": "off", "quote-props": "off", "no-underscore-dangle": "off", "max-len": "off", "no-use-before-define": "off", "no-empty": "off", "no-else-return": "off", "no-throw-literal": "off", "newline-per-chained-call": "off", "consistent-return": "off", "no-mixed-operators": "off", "no-prototype-builtins": "off", "no-multiple-empty-lines": ["error", { "max": 2, "maxBOF": 0, "maxEOF": 0 } ], "new-cap": ["error", { "capIsNewExceptions": [ "ShellString" ]} ] } } node-shelljs-0.8.3/.gitattributes000066400000000000000000000000161342005425100167750ustar00rootroot00000000000000* text eol=lf node-shelljs-0.8.3/.github/000077500000000000000000000000001342005425100154455ustar00rootroot00000000000000node-shelljs-0.8.3/.github/ISSUE_TEMPLATE.md000066400000000000000000000006101342005425100201470ustar00rootroot00000000000000 ### Node version (or tell us if you're using electron or some other framework): ### ShellJS version (the most recent version/Github branch you see the bug on): ### Operating system: ### Description of the bug: ### Example ShellJS command to reproduce the error: ```javascript ``` node-shelljs-0.8.3/.gitignore000066400000000000000000000002441342005425100160750ustar00rootroot00000000000000# Project npm-debug.log* node_modules tmp coverage/ .nyc_output/ # Linux *~ # JetBrains .idea # Vim ## swap [._]*.s[a-w][a-z] [._]s[a-w][a-z] # OS X .DS_Store node-shelljs-0.8.3/.travis.yml000066400000000000000000000020511342005425100162140ustar00rootroot00000000000000language: c++ sudo: false env: - NODE_VERSION="4" - NODE_VERSION="5" - NODE_VERSION="6" - NODE_VERSION="7" - NODE_VERSION="8" - NODE_VERSION="9" # keep this blank to make sure there are no before_install steps before_install: install: - rm -rf ~/.nvm - git clone https://github.com/creationix/nvm.git ~/.nvm - source ~/.nvm/nvm.sh - nvm install $NODE_VERSION - node --version - npm --version - npm run ci-or-install os: - linux - osx script: - npm test # make sure when the docs are generated nothing changes (a.k.a. the docs have already been generated) - npm run gendocs - npm run after-travis "Make sure to generate docs!" after_success: - npm run codecov -- -f coverage/lcov.info # Gitter notifications: email: false webhooks: urls: - https://webhooks.gitter.im/e/743dc6b83b6dd05111ee on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: never # options: [always|never|change] default: always node-shelljs-0.8.3/CHANGELOG.md000066400000000000000000002413521342005425100157250ustar00rootroot00000000000000# Change Log ## [Unreleased](https://github.com/shelljs/shelljs/tree/HEAD) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.8.2...HEAD) **Closed issues:** - Shelljs print stderr to console even if exec-only "silent" is true [\#905](https://github.com/shelljs/shelljs/issues/905) - refactor: remove common.state.tempDir [\#902](https://github.com/shelljs/shelljs/issues/902) - Can't suppress stdout for echo [\#899](https://github.com/shelljs/shelljs/issues/899) - exec\(\) doesn't apply the arguments correctly [\#895](https://github.com/shelljs/shelljs/issues/895) - Travis CI currently broken [\#893](https://github.com/shelljs/shelljs/issues/893) - shell.exec\('npm pack'\) painfully slow [\#885](https://github.com/shelljs/shelljs/issues/885) - shelljs.exec cannot find app.asar/node\_modules/shelljs/src/exec-child.js [\#881](https://github.com/shelljs/shelljs/issues/881) - test infra: mocks and skipOnWin conflict [\#862](https://github.com/shelljs/shelljs/issues/862) - Support for shell function completion on IDE [\#859](https://github.com/shelljs/shelljs/issues/859) - echo command shows options in stdout [\#855](https://github.com/shelljs/shelljs/issues/855) - silent does not always work [\#851](https://github.com/shelljs/shelljs/issues/851) - Appveyor installs the latest npm, instead of the latest compatible npm [\#844](https://github.com/shelljs/shelljs/issues/844) - Force symbolic link \(ln -sf\) does not overwrite/recreate existing destination [\#830](https://github.com/shelljs/shelljs/issues/830) - inconsistent result when trying to echo to a file [\#798](https://github.com/shelljs/shelljs/issues/798) - Prevent require\(\)ing executable-only files [\#789](https://github.com/shelljs/shelljs/issues/789) - Cannot set property to of \[object String\] which has only a getter [\#752](https://github.com/shelljs/shelljs/issues/752) - which\(\) should check executability before returning a value [\#657](https://github.com/shelljs/shelljs/issues/657) - Bad encoding experience [\#456](https://github.com/shelljs/shelljs/issues/456) - phpcs very slow [\#440](https://github.com/shelljs/shelljs/issues/440) - Error shown when triggering a sigint during shelljs.exec if process.on sigint is defined [\#254](https://github.com/shelljs/shelljs/issues/254) - `.to\(file\)` does not mute STDIO output [\#146](https://github.com/shelljs/shelljs/issues/146) - Escaping shell arguments to exec\(\) [\#143](https://github.com/shelljs/shelljs/issues/143) - Allow multiple string arguments for exec\(\) [\#103](https://github.com/shelljs/shelljs/issues/103) - cp does not recursively copy from readonly location [\#98](https://github.com/shelljs/shelljs/issues/98) - Handling permissions errors on file I/O [\#64](https://github.com/shelljs/shelljs/issues/64) **Merged pull requests:** - refactor: don't expose tempdir in common.state [\#903](https://github.com/shelljs/shelljs/pull/903) ([nfischer](https://github.com/nfischer)) - chore\(ci\): fix codecov on travis [\#897](https://github.com/shelljs/shelljs/pull/897) ([nfischer](https://github.com/nfischer)) - chore\(npm\): add ci-or-install script [\#896](https://github.com/shelljs/shelljs/pull/896) ([nfischer](https://github.com/nfischer)) - Fix silent exec [\#892](https://github.com/shelljs/shelljs/pull/892) ([nfischer](https://github.com/nfischer)) - chore\(appveyor\): run entire test matrix [\#886](https://github.com/shelljs/shelljs/pull/886) ([nfischer](https://github.com/nfischer)) - docs: remove gitter badge [\#880](https://github.com/shelljs/shelljs/pull/880) ([nfischer](https://github.com/nfischer)) - grep includes the i flag [\#876](https://github.com/shelljs/shelljs/pull/876) ([ppsleep](https://github.com/ppsleep)) - Fix\(which\): match only executable files \(\#657\) [\#874](https://github.com/shelljs/shelljs/pull/874) ([termosa](https://github.com/termosa)) - chore: rename some tests [\#871](https://github.com/shelljs/shelljs/pull/871) ([nfischer](https://github.com/nfischer)) - Fix cp from readonly source [\#870](https://github.com/shelljs/shelljs/pull/870) ([nfischer](https://github.com/nfischer)) - chore: bump dev dependencies and add package-lock [\#864](https://github.com/shelljs/shelljs/pull/864) ([nfischer](https://github.com/nfischer)) - fix\(mocks\): fix conflict between mocks and skip [\#863](https://github.com/shelljs/shelljs/pull/863) ([nfischer](https://github.com/nfischer)) - chore: output npm version in travis [\#850](https://github.com/shelljs/shelljs/pull/850) ([nfischer](https://github.com/nfischer)) - Prevent require-ing bin/shjs [\#848](https://github.com/shelljs/shelljs/pull/848) ([freitagbr](https://github.com/freitagbr)) - chore\(appveyor\): do not use latest npm [\#847](https://github.com/shelljs/shelljs/pull/847) ([nfischer](https://github.com/nfischer)) - chore: update shelljs-release version [\#846](https://github.com/shelljs/shelljs/pull/846) ([nfischer](https://github.com/nfischer)) ## [v0.8.2](https://github.com/shelljs/shelljs/tree/v0.8.2) (2018-05-08) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.8.1...v0.8.2) **Closed issues:** - High severity vulnerability in shelljs 0.8.1 [\#842](https://github.com/shelljs/shelljs/issues/842) - Add test for ls\(\) on a symlink to a directory [\#795](https://github.com/shelljs/shelljs/issues/795) - Harden shell.exec by writing the child process in a source file [\#782](https://github.com/shelljs/shelljs/issues/782) - shell.exec\(\) doesn't respond correctly to config.fatal = true [\#735](https://github.com/shelljs/shelljs/issues/735) - Merge 'exec: internal error' with ShellJSInternalError [\#734](https://github.com/shelljs/shelljs/issues/734) - exec returning null from command [\#724](https://github.com/shelljs/shelljs/issues/724) - Only Get Stderr from Exec [\#371](https://github.com/shelljs/shelljs/issues/371) - Execute child.stdout.on before child.on\("exit"\) [\#224](https://github.com/shelljs/shelljs/issues/224) **Merged pull requests:** - Workaround codecov bug of miscalculation of coverage \(\#795\) [\#838](https://github.com/shelljs/shelljs/pull/838) ([dwi2](https://github.com/dwi2)) - Update doc comments and regenerate README.md. [\#825](https://github.com/shelljs/shelljs/pull/825) ([Zearin](https://github.com/Zearin)) - chore: update contributing guidelines [\#817](https://github.com/shelljs/shelljs/pull/817) ([nfischer](https://github.com/nfischer)) - chore\(lint\): don't allow excess trailing newlines [\#816](https://github.com/shelljs/shelljs/pull/816) ([nfischer](https://github.com/nfischer)) - Remove separate "internal error" from exec [\#802](https://github.com/shelljs/shelljs/pull/802) ([freitagbr](https://github.com/freitagbr)) ## [v0.8.1](https://github.com/shelljs/shelljs/tree/v0.8.1) (2018-01-20) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.8.0...v0.8.1) **Closed issues:** - Exec failing with internal error when piping large output [\#818](https://github.com/shelljs/shelljs/issues/818) **Merged pull requests:** - Revert "refactor\(exec\): remove paramsFile \(\#807\)" [\#819](https://github.com/shelljs/shelljs/pull/819) ([nfischer](https://github.com/nfischer)) ## [v0.8.0](https://github.com/shelljs/shelljs/tree/v0.8.0) (2018-01-12) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.8...v0.8.0) **Closed issues:** - Snyk vulnerability DB reporting command injection vulnerability in ShellJS [\#810](https://github.com/shelljs/shelljs/issues/810) - chore: upgrade nyc [\#803](https://github.com/shelljs/shelljs/issues/803) - Update CI to use Node v9 [\#799](https://github.com/shelljs/shelljs/issues/799) - Link to FAQ wiki section in our issue template [\#787](https://github.com/shelljs/shelljs/issues/787) - Is it possible to get a js library\(file\) for ShellJS [\#776](https://github.com/shelljs/shelljs/issues/776) - 48, [\#774](https://github.com/shelljs/shelljs/issues/774) - 47 [\#773](https://github.com/shelljs/shelljs/issues/773) - Exec function calls JSON.stringify on command [\#772](https://github.com/shelljs/shelljs/issues/772) - getting different result from terminal and with shelljs [\#769](https://github.com/shelljs/shelljs/issues/769) - test\(\) does not support -w and -x options [\#768](https://github.com/shelljs/shelljs/issues/768) - Snyk "high severity" issue [\#766](https://github.com/shelljs/shelljs/issues/766) - Snyk "high security [\#765](https://github.com/shelljs/shelljs/issues/765) - ShellJS doesn't respect NPM Registry being set outside of it [\#761](https://github.com/shelljs/shelljs/issues/761) - Run second shell script [\#756](https://github.com/shelljs/shelljs/issues/756) - shelljs seems NOT compatible with nexe under CentOS 6.5 [\#754](https://github.com/shelljs/shelljs/issues/754) - Feature request: pushd/popd -q option [\#753](https://github.com/shelljs/shelljs/issues/753) - cat doesn't support '-n' option [\#750](https://github.com/shelljs/shelljs/issues/750) - shelljs run xcodebuild error [\#749](https://github.com/shelljs/shelljs/issues/749) - Add wrappers around fs.statSync and fs.lstatSync [\#745](https://github.com/shelljs/shelljs/issues/745) - Improve coverage for exec\(\) [\#742](https://github.com/shelljs/shelljs/issues/742) - Improve coverage for head\(\) [\#741](https://github.com/shelljs/shelljs/issues/741) - shelljs is no longer used in PDF.js [\#737](https://github.com/shelljs/shelljs/issues/737) - ls doesn't follow links to directories [\#733](https://github.com/shelljs/shelljs/issues/733) - Add test for `ls regular-file.txt` [\#732](https://github.com/shelljs/shelljs/issues/732) - Clean up common tests [\#714](https://github.com/shelljs/shelljs/issues/714) - Cant get encoding buffer to work on exec [\#675](https://github.com/shelljs/shelljs/issues/675) - Set up Codecov for the project [\#671](https://github.com/shelljs/shelljs/issues/671) - ShellJS: internal error Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys' [\#514](https://github.com/shelljs/shelljs/issues/514) - Feature request: provide a way to skip option parsing [\#778](https://github.com/shelljs/shelljs/issues/778) - Switch to os.homedir\(\) when we move to v4+ [\#683](https://github.com/shelljs/shelljs/issues/683) - Drop support for v0.12 [\#647](https://github.com/shelljs/shelljs/issues/647) - feature: echo -n [\#559](https://github.com/shelljs/shelljs/issues/559) - Don't kill the node process upon unexpected error [\#483](https://github.com/shelljs/shelljs/issues/483) - Echo doesn't return value ending in a trailing newline [\#476](https://github.com/shelljs/shelljs/issues/476) - Synchronous exec stalls permenantly when there is an error/w the shell [\#7](https://github.com/shelljs/shelljs/issues/7) **Merged pull requests:** - docs: announce plugin API [\#812](https://github.com/shelljs/shelljs/pull/812) ([nfischer](https://github.com/nfischer)) - chore: update CI to Node v9 [\#811](https://github.com/shelljs/shelljs/pull/811) ([nfischer](https://github.com/nfischer)) - refactor\(exec\): remove paramsFile [\#807](https://github.com/shelljs/shelljs/pull/807) ([nfischer](https://github.com/nfischer)) - chore: update nyc dependency [\#805](https://github.com/shelljs/shelljs/pull/805) ([nfischer](https://github.com/nfischer)) - refactor: harden plugins against unknown options [\#804](https://github.com/shelljs/shelljs/pull/804) ([nfischer](https://github.com/nfischer)) - chore\(eslint\): use words instead of numbers [\#797](https://github.com/shelljs/shelljs/pull/797) ([nfischer](https://github.com/nfischer)) - Add note to issue template about FAQ [\#794](https://github.com/shelljs/shelljs/pull/794) ([freitagbr](https://github.com/freitagbr)) - Remove codeFile parameter [\#791](https://github.com/shelljs/shelljs/pull/791) ([nfischer](https://github.com/nfischer)) - Use execFileSync to launch child process [\#790](https://github.com/shelljs/shelljs/pull/790) ([nfischer](https://github.com/nfischer)) - refactor\(exec\): move child process to source file [\#786](https://github.com/shelljs/shelljs/pull/786) ([nfischer](https://github.com/nfischer)) - Remove unnecessary shell.error checks from common tests [\#785](https://github.com/shelljs/shelljs/pull/785) ([freitagbr](https://github.com/freitagbr)) - Add a test for ls for a single file [\#784](https://github.com/shelljs/shelljs/pull/784) ([freitagbr](https://github.com/freitagbr)) - Wrap fs.statSync and fs.lstatSync [\#783](https://github.com/shelljs/shelljs/pull/783) ([freitagbr](https://github.com/freitagbr)) - chore: set AVA options [\#780](https://github.com/shelljs/shelljs/pull/780) ([nfischer](https://github.com/nfischer)) - chore: clean up refs to unsupported node versions [\#779](https://github.com/shelljs/shelljs/pull/779) ([nfischer](https://github.com/nfischer)) - Added `-q` \(quiet\) option to `push`, `popd`, `dirs` functions. [\#777](https://github.com/shelljs/shelljs/pull/777) ([alexreg](https://github.com/alexreg)) - feat\(cat\): number output lines \(\#750\) [\#775](https://github.com/shelljs/shelljs/pull/775) ([gcca](https://github.com/gcca)) - refactor\(test\): update AVA and refactor tests [\#760](https://github.com/shelljs/shelljs/pull/760) ([nfischer](https://github.com/nfischer)) - chore: add skipOnWin and skipOnUnix test helpers [\#746](https://github.com/shelljs/shelljs/pull/746) ([nfischer](https://github.com/nfischer)) - test\(exec\): add tests for coverage [\#744](https://github.com/shelljs/shelljs/pull/744) ([nfischer](https://github.com/nfischer)) - test\(head\): improve coverage [\#743](https://github.com/shelljs/shelljs/pull/743) ([nfischer](https://github.com/nfischer)) - Remove PDF.js mention from README.md [\#738](https://github.com/shelljs/shelljs/pull/738) ([voy](https://github.com/voy)) - Provide an API to pass parameters which resemble options [\#792](https://github.com/shelljs/shelljs/pull/792) ([nfischer](https://github.com/nfischer)) - Fix ls not following links to directories by default [\#764](https://github.com/shelljs/shelljs/pull/764) ([freitagbr](https://github.com/freitagbr)) - Add "encoding" option to exec [\#763](https://github.com/shelljs/shelljs/pull/763) ([freitagbr](https://github.com/freitagbr)) - Merge dev into master [\#731](https://github.com/shelljs/shelljs/pull/731) ([freitagbr](https://github.com/freitagbr)) - Deprecate common.getUserHome, advise using os.homedir instead [\#725](https://github.com/shelljs/shelljs/pull/725) ([freitagbr](https://github.com/freitagbr)) - Echo test mocks [\#708](https://github.com/shelljs/shelljs/pull/708) ([freitagbr](https://github.com/freitagbr)) - Safely exit by throwing an error [\#546](https://github.com/shelljs/shelljs/pull/546) ([freitagbr](https://github.com/freitagbr)) - chore\(make\): depreciate shelljs/make [\#431](https://github.com/shelljs/shelljs/pull/431) ([ariporad](https://github.com/ariporad)) ## [v0.7.8](https://github.com/shelljs/shelljs/tree/v0.7.8) (2017-06-07) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.7...v0.7.8) **Closed issues:** - Add node v8 to CI [\#729](https://github.com/shelljs/shelljs/issues/729) - Exec not working in Electron ! [\#726](https://github.com/shelljs/shelljs/issues/726) - is rechoir used anywhere? [\#723](https://github.com/shelljs/shelljs/issues/723) - ShellJS: internal error on shelljs.mkdir\('myFile/myDir'\) [\#720](https://github.com/shelljs/shelljs/issues/720) - Can't make sed perform global replace [\#719](https://github.com/shelljs/shelljs/issues/719) - grep: option not recognized: l [\#717](https://github.com/shelljs/shelljs/issues/717) - Problems getting code, stdout, stderr [\#715](https://github.com/shelljs/shelljs/issues/715) - Copying hidden files fails on Windows 10 [\#711](https://github.com/shelljs/shelljs/issues/711) - How am I suppose to handle errors with ShellJS? [\#707](https://github.com/shelljs/shelljs/issues/707) - use cp\('-r', './src', './dist'\) bug [\#705](https://github.com/shelljs/shelljs/issues/705) - Way to ignore files in globs. [\#699](https://github.com/shelljs/shelljs/issues/699) - Buffer constructor is deprecated [\#694](https://github.com/shelljs/shelljs/issues/694) - source command not working via exec method. [\#693](https://github.com/shelljs/shelljs/issues/693) - Would you be interested in a PR for `open`? [\#692](https://github.com/shelljs/shelljs/issues/692) - Get rid of common.platform in favor of process.platform [\#670](https://github.com/shelljs/shelljs/issues/670) - Passing empty string to cp throws internal error [\#664](https://github.com/shelljs/shelljs/issues/664) - Why does sed split files into an array, call replace on each line and rejoin? [\#645](https://github.com/shelljs/shelljs/issues/645) - feat: cp & mv should not overwrite recently created files [\#631](https://github.com/shelljs/shelljs/issues/631) - Echo tests unnecessarily run tests in own process [\#622](https://github.com/shelljs/shelljs/issues/622) - rm -rf on a symbolic link to a dir deletes its contents [\#587](https://github.com/shelljs/shelljs/issues/587) - "Cannot extract package" with node-webkit [\#181](https://github.com/shelljs/shelljs/issues/181) - EBADF, bad file descriptor [\#180](https://github.com/shelljs/shelljs/issues/180) **Merged pull requests:** - Add node 8 to CI [\#730](https://github.com/shelljs/shelljs/pull/730) ([freitagbr](https://github.com/freitagbr)) - fix\(mkdir\): improve error handling around files [\#721](https://github.com/shelljs/shelljs/pull/721) ([nfischer](https://github.com/nfischer)) - Properly handle directories as arguments [\#713](https://github.com/shelljs/shelljs/pull/713) ([nfischer](https://github.com/nfischer)) - Add common.buffer [\#710](https://github.com/shelljs/shelljs/pull/710) ([freitagbr](https://github.com/freitagbr)) - Fix common.expand error [\#709](https://github.com/shelljs/shelljs/pull/709) ([freitagbr](https://github.com/freitagbr)) - refactor: remove unnecessary common.js imports [\#703](https://github.com/shelljs/shelljs/pull/703) ([nfischer](https://github.com/nfischer)) - Fix \#631 throw error when overwriting recently created file [\#702](https://github.com/shelljs/shelljs/pull/702) ([uttpal](https://github.com/uttpal)) - Small clarification of verbose flag [\#691](https://github.com/shelljs/shelljs/pull/691) ([zommerfelds](https://github.com/zommerfelds)) - fix\(grep, sed, sort, uniq\): Split only on newline characters [\#690](https://github.com/shelljs/shelljs/pull/690) ([freitagbr](https://github.com/freitagbr)) - Refactor: Use process.platform across codebase [\#689](https://github.com/shelljs/shelljs/pull/689) ([freitagbr](https://github.com/freitagbr)) - Remove contents of symlink to dir with rm -rf [\#688](https://github.com/shelljs/shelljs/pull/688) ([freitagbr](https://github.com/freitagbr)) - Echo stdout [\#677](https://github.com/shelljs/shelljs/pull/677) ([nfischer](https://github.com/nfischer)) ## [v0.7.7](https://github.com/shelljs/shelljs/tree/v0.7.7) (2017-03-09) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.6...v0.7.7) **Closed issues:** - Error output should be consistent across all platforms. [\#681](https://github.com/shelljs/shelljs/issues/681) - \*CRITICAL data loss\* shell.cp\(\) Content of file is erased when trying to copy it to the folder it already belongs to [\#678](https://github.com/shelljs/shelljs/issues/678) - Use with webpack broken in 0.7.6 [\#667](https://github.com/shelljs/shelljs/issues/667) - Difference between bash ls -R and ShellJS ls -R with symlinks [\#666](https://github.com/shelljs/shelljs/issues/666) - Refactor which\(\) \(too many repeated code blocks\) [\#656](https://github.com/shelljs/shelljs/issues/656) - find\(\) raises error when unable to find any files matching, expected to return empty array. [\#653](https://github.com/shelljs/shelljs/issues/653) - Reformat the markdown in RELEASE.md [\#642](https://github.com/shelljs/shelljs/issues/642) - rm -rf doesn't work if the directory contains an asar archive in Electron [\#618](https://github.com/shelljs/shelljs/issues/618) - Add support for other file types in rm [\#617](https://github.com/shelljs/shelljs/issues/617) - Feature request: ls -L option [\#563](https://github.com/shelljs/shelljs/issues/563) - How to send SIGINT signal to child process launched with exec [\#518](https://github.com/shelljs/shelljs/issues/518) - feature request: option to add node\_modules to the path for shelljs scripts [\#469](https://github.com/shelljs/shelljs/issues/469) - high cpu usage during synchronous exec [\#167](https://github.com/shelljs/shelljs/issues/167) **Merged pull requests:** - Add support for removing fifos [\#687](https://github.com/shelljs/shelljs/pull/687) ([freitagbr](https://github.com/freitagbr)) - chore: add codecov script to appveyor CI [\#686](https://github.com/shelljs/shelljs/pull/686) ([nfischer](https://github.com/nfischer)) - Refactor tests to improve readability [\#685](https://github.com/shelljs/shelljs/pull/685) ([nfischer](https://github.com/nfischer)) - fix: convert error output to be consistent cross-platform [\#684](https://github.com/shelljs/shelljs/pull/684) ([nfischer](https://github.com/nfischer)) - chore: add codecov [\#682](https://github.com/shelljs/shelljs/pull/682) ([nfischer](https://github.com/nfischer)) - Fix cp overwriting identical files [\#679](https://github.com/shelljs/shelljs/pull/679) ([freitagbr](https://github.com/freitagbr)) - Modified glob pattern. Fixes \#666 [\#676](https://github.com/shelljs/shelljs/pull/676) ([frandiox](https://github.com/frandiox)) - refactor\(parseOptions\): better handle errors [\#674](https://github.com/shelljs/shelljs/pull/674) ([nfischer](https://github.com/nfischer)) - test: add misc. tests to improve coverage [\#673](https://github.com/shelljs/shelljs/pull/673) ([nfischer](https://github.com/nfischer)) - test: don't count hard-to-test lines for coverage [\#672](https://github.com/shelljs/shelljs/pull/672) ([nfischer](https://github.com/nfischer)) - fix: switch commands.json -\> commands.js [\#668](https://github.com/shelljs/shelljs/pull/668) ([nfischer](https://github.com/nfischer)) - ls -L \(follow symlinks\) [\#665](https://github.com/shelljs/shelljs/pull/665) ([frandiox](https://github.com/frandiox)) - docs\(chmod\): document `options` argument [\#663](https://github.com/shelljs/shelljs/pull/663) ([gkalpak](https://github.com/gkalpak)) - docs: clean up RELEASE.md [\#662](https://github.com/shelljs/shelljs/pull/662) ([nfischer](https://github.com/nfischer)) - docs: miscellaneous README changes [\#661](https://github.com/shelljs/shelljs/pull/661) ([nfischer](https://github.com/nfischer)) - Fix typo in README [\#660](https://github.com/shelljs/shelljs/pull/660) ([faheel](https://github.com/faheel)) - refactor: reduce repeated code in which\(\) [\#659](https://github.com/shelljs/shelljs/pull/659) ([nfischer](https://github.com/nfischer)) - feature: add -a option for which command [\#655](https://github.com/shelljs/shelljs/pull/655) ([termosa](https://github.com/termosa)) - Fix find ENOENT [\#654](https://github.com/shelljs/shelljs/pull/654) ([freitagbr](https://github.com/freitagbr)) - Safely exit by throwing an error [\#649](https://github.com/shelljs/shelljs/pull/649) ([freitagbr](https://github.com/freitagbr)) - Chore drop 0.12 [\#648](https://github.com/shelljs/shelljs/pull/648) ([nfischer](https://github.com/nfischer)) - chore\(lint\): Enforce a trailing comma for multi-line [\#646](https://github.com/shelljs/shelljs/pull/646) ([nfischer](https://github.com/nfischer)) - docs\(release\): use bulleted list [\#643](https://github.com/shelljs/shelljs/pull/643) ([freitagbr](https://github.com/freitagbr)) ## [v0.7.6](https://github.com/shelljs/shelljs/tree/v0.7.6) (2017-01-08) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.5...v0.7.6) **Closed issues:** - unable to execute ionic command with shell js [\#640](https://github.com/shelljs/shelljs/issues/640) - How to increase ShellJS buffer size? [\#639](https://github.com/shelljs/shelljs/issues/639) - mkdir fails with non-normalized path [\#634](https://github.com/shelljs/shelljs/issues/634) - Move execPath into common [\#633](https://github.com/shelljs/shelljs/issues/633) - QUESTION: Feedback while an operation is running? [\#629](https://github.com/shelljs/shelljs/issues/629) - Test setup/cleanup is broken [\#621](https://github.com/shelljs/shelljs/issues/621) - Ignore temp directories when running lint [\#620](https://github.com/shelljs/shelljs/issues/620) - parseOptions should throw an error if the option string doesn't start with '-' [\#614](https://github.com/shelljs/shelljs/issues/614) - chore: LGTM.co is gone [\#595](https://github.com/shelljs/shelljs/issues/595) - refactor: objectAssign should refer to Object.assign if it exists, or the internal polyfill otherwise [\#592](https://github.com/shelljs/shelljs/issues/592) - parseOptions: allow a way to keep errors silent \(exception only\) [\#591](https://github.com/shelljs/shelljs/issues/591) - \[Question\] commands with multiple options / arguments? [\#589](https://github.com/shelljs/shelljs/issues/589) - feature: GNU Parallel [\#585](https://github.com/shelljs/shelljs/issues/585) - write to file [\#568](https://github.com/shelljs/shelljs/issues/568) - Cannot figure out how to disable globbing for rm [\#567](https://github.com/shelljs/shelljs/issues/567) - Switch to the ava test framework [\#560](https://github.com/shelljs/shelljs/issues/560) - Option not recognized [\#556](https://github.com/shelljs/shelljs/issues/556) - chore: add @freitagbr to LGTM maintainers [\#552](https://github.com/shelljs/shelljs/issues/552) - chore: set up dev branch [\#548](https://github.com/shelljs/shelljs/issues/548) - bug: cp\(\) doesn't always copy everything [\#547](https://github.com/shelljs/shelljs/issues/547) - User-friendly lint command [\#544](https://github.com/shelljs/shelljs/issues/544) - Lint warning [\#542](https://github.com/shelljs/shelljs/issues/542) - chore: add nodejs v7 to CI [\#537](https://github.com/shelljs/shelljs/issues/537) - error.code is not always available [\#536](https://github.com/shelljs/shelljs/issues/536) - Add shx as a dependency for testing [\#525](https://github.com/shelljs/shelljs/issues/525) - Feature request: allow `common.error\(\)` to optionally not insert a prefix and optionally not print to console [\#523](https://github.com/shelljs/shelljs/issues/523) - Feature request: Add "shelljs.unlink" [\#519](https://github.com/shelljs/shelljs/issues/519) - Sed should allow a replacement string to contain `\1` for match groups [\#507](https://github.com/shelljs/shelljs/issues/507) - Usage with neodoc [\#445](https://github.com/shelljs/shelljs/issues/445) - \[ Feature idea \] synchronous sleep command [\#441](https://github.com/shelljs/shelljs/issues/441) - Improve test coverage [\#347](https://github.com/shelljs/shelljs/issues/347) - Add a way to prevent shell-expansion on commands \(this issue is not for exec\) [\#345](https://github.com/shelljs/shelljs/issues/345) - Chown [\#183](https://github.com/shelljs/shelljs/issues/183) - spawn EMFILE [\#81](https://github.com/shelljs/shelljs/issues/81) - Rewrite exec using execsync-ng \(which uses node-ffi\) [\#66](https://github.com/shelljs/shelljs/issues/66) - `exec` gets stuck on my Debian box [\#51](https://github.com/shelljs/shelljs/issues/51) - 100% cpu usage when a nodejs script goes side ways executing a command. [\#5](https://github.com/shelljs/shelljs/issues/5) **Merged pull requests:** - refactor: add config.reset\(\) and .resetForTesting\(\) [\#641](https://github.com/shelljs/shelljs/pull/641) ([nfischer](https://github.com/nfischer)) - chore: set up test coverage [\#638](https://github.com/shelljs/shelljs/pull/638) ([nfischer](https://github.com/nfischer)) - refactor: create common.execPath [\#636](https://github.com/shelljs/shelljs/pull/636) ([nfischer](https://github.com/nfischer)) - fix: allow non-normalized paths as input to mkdir [\#635](https://github.com/shelljs/shelljs/pull/635) ([nfischer](https://github.com/nfischer)) - Finalize moving to ava [\#630](https://github.com/shelljs/shelljs/pull/630) ([freitagbr](https://github.com/freitagbr)) - test: refactor pushd tests to AVA [\#627](https://github.com/shelljs/shelljs/pull/627) ([nfischer](https://github.com/nfischer)) - test: refactor popd tests to AVA [\#626](https://github.com/shelljs/shelljs/pull/626) ([nfischer](https://github.com/nfischer)) - test: refactor shjs tests to AVA [\#625](https://github.com/shelljs/shelljs/pull/625) ([nfischer](https://github.com/nfischer)) - test: remove tests for make \(deprecated\) [\#624](https://github.com/shelljs/shelljs/pull/624) ([nfischer](https://github.com/nfischer)) - Ignore test temp directories during linting [\#623](https://github.com/shelljs/shelljs/pull/623) ([freitagbr](https://github.com/freitagbr)) - refactor: list all commands in commands.json [\#616](https://github.com/shelljs/shelljs/pull/616) ([nfischer](https://github.com/nfischer)) - Throw an error if the options string does not start with '-' [\#615](https://github.com/shelljs/shelljs/pull/615) ([freitagbr](https://github.com/freitagbr)) - chore: switch to files attribute from npmignore [\#613](https://github.com/shelljs/shelljs/pull/613) ([nfischer](https://github.com/nfischer)) - test: refactor 'test' command tests to AVA [\#612](https://github.com/shelljs/shelljs/pull/612) ([nfischer](https://github.com/nfischer)) - test: refactor find tests to AVA [\#611](https://github.com/shelljs/shelljs/pull/611) ([nfischer](https://github.com/nfischer)) - test: refactor ln tests to AVA [\#610](https://github.com/shelljs/shelljs/pull/610) ([nfischer](https://github.com/nfischer)) - test: refactor ls to use AVA [\#609](https://github.com/shelljs/shelljs/pull/609) ([nfischer](https://github.com/nfischer)) - test: refactor pipe tests to AVA [\#608](https://github.com/shelljs/shelljs/pull/608) ([nfischer](https://github.com/nfischer)) - test: refactor sed tests to AVA [\#607](https://github.com/shelljs/shelljs/pull/607) ([nfischer](https://github.com/nfischer)) - test: refactor grep tests to AVA [\#606](https://github.com/shelljs/shelljs/pull/606) ([nfischer](https://github.com/nfischer)) - test: refactor global tests to AVA [\#605](https://github.com/shelljs/shelljs/pull/605) ([nfischer](https://github.com/nfischer)) - test: refactor touch tests to AVA [\#604](https://github.com/shelljs/shelljs/pull/604) ([nfischer](https://github.com/nfischer)) - test: refactor uniq tests to AVA [\#603](https://github.com/shelljs/shelljs/pull/603) ([nfischer](https://github.com/nfischer)) - test: refactor sort tests to AVA [\#602](https://github.com/shelljs/shelljs/pull/602) ([nfischer](https://github.com/nfischer)) - test: refactor tail tests to AVA [\#601](https://github.com/shelljs/shelljs/pull/601) ([nfischer](https://github.com/nfischer)) - test: refactor head tests to AVA [\#600](https://github.com/shelljs/shelljs/pull/600) ([nfischer](https://github.com/nfischer)) - test: refactor mkdir tests to AVA [\#599](https://github.com/shelljs/shelljs/pull/599) ([nfischer](https://github.com/nfischer)) - Fix: rm behavior regarding symlinks [\#598](https://github.com/shelljs/shelljs/pull/598) ([freitagbr](https://github.com/freitagbr)) - test: refactor mv tests to AVA [\#597](https://github.com/shelljs/shelljs/pull/597) ([nfischer](https://github.com/nfischer)) - Remove files related to lgtm.co [\#596](https://github.com/shelljs/shelljs/pull/596) ([freitagbr](https://github.com/freitagbr)) - Add ability to configure error from parseOptions [\#594](https://github.com/shelljs/shelljs/pull/594) ([freitagbr](https://github.com/freitagbr)) - Use Object.assign if possible [\#593](https://github.com/shelljs/shelljs/pull/593) ([freitagbr](https://github.com/freitagbr)) - Add "-n" option to echo [\#590](https://github.com/shelljs/shelljs/pull/590) ([freitagbr](https://github.com/freitagbr)) - test: refactor rm tests to AVA [\#586](https://github.com/shelljs/shelljs/pull/586) ([nfischer](https://github.com/nfischer)) - test: refactor pwd tests to AVA [\#582](https://github.com/shelljs/shelljs/pull/582) ([nfischer](https://github.com/nfischer)) - test: refactor tempdir tests to AVA [\#581](https://github.com/shelljs/shelljs/pull/581) ([nfischer](https://github.com/nfischer)) - test: refactor 'which' tests to AVA [\#580](https://github.com/shelljs/shelljs/pull/580) ([nfischer](https://github.com/nfischer)) - test: refactor plugin tests to AVA [\#579](https://github.com/shelljs/shelljs/pull/579) ([nfischer](https://github.com/nfischer)) - test: refactor toEnd tests to AVA [\#578](https://github.com/shelljs/shelljs/pull/578) ([nfischer](https://github.com/nfischer)) - test: refactor to tests to AVA [\#577](https://github.com/shelljs/shelljs/pull/577) ([nfischer](https://github.com/nfischer)) - test: refactor 'set' tests to AVA [\#576](https://github.com/shelljs/shelljs/pull/576) ([nfischer](https://github.com/nfischer)) - test: refactor echo tests to AVA [\#575](https://github.com/shelljs/shelljs/pull/575) ([nfischer](https://github.com/nfischer)) - test: refactor exec tests to AVA [\#574](https://github.com/shelljs/shelljs/pull/574) ([nfischer](https://github.com/nfischer)) - test: refactor env tests to AVA [\#573](https://github.com/shelljs/shelljs/pull/573) ([nfischer](https://github.com/nfischer)) - test: refactor dirs tests to AVA [\#572](https://github.com/shelljs/shelljs/pull/572) ([nfischer](https://github.com/nfischer)) - test: refactor config tests to AVA [\#571](https://github.com/shelljs/shelljs/pull/571) ([nfischer](https://github.com/nfischer)) - test: refactor common tests to AVA [\#570](https://github.com/shelljs/shelljs/pull/570) ([nfischer](https://github.com/nfischer)) - test: refactor chmod tests to AVA [\#569](https://github.com/shelljs/shelljs/pull/569) ([nfischer](https://github.com/nfischer)) - test: refactor cp tests to ava [\#565](https://github.com/shelljs/shelljs/pull/565) ([nfischer](https://github.com/nfischer)) - test: refactor cat tests to ava [\#564](https://github.com/shelljs/shelljs/pull/564) ([nfischer](https://github.com/nfischer)) - test: set up ava and move cd.js [\#561](https://github.com/shelljs/shelljs/pull/561) ([nfischer](https://github.com/nfischer)) - Update sed documentation regarding capture groups [\#558](https://github.com/shelljs/shelljs/pull/558) ([freitagbr](https://github.com/freitagbr)) - Add newline to output of echo [\#557](https://github.com/shelljs/shelljs/pull/557) ([freitagbr](https://github.com/freitagbr)) - fix: handle code-less errors more carefully in exec [\#554](https://github.com/shelljs/shelljs/pull/554) ([nfischer](https://github.com/nfischer)) - Add Brandon Freitag to maintainers/contributors [\#553](https://github.com/shelljs/shelljs/pull/553) ([freitagbr](https://github.com/freitagbr)) - Get pipe tests running on Windows. [\#550](https://github.com/shelljs/shelljs/pull/550) ([binki](https://github.com/binki)) - fix: maxdepth doesn't limit total number of copies [\#549](https://github.com/shelljs/shelljs/pull/549) ([nfischer](https://github.com/nfischer)) - Fix lint warning [\#543](https://github.com/shelljs/shelljs/pull/543) ([freitagbr](https://github.com/freitagbr)) - chore: remove v0.10 from Travis CI [\#540](https://github.com/shelljs/shelljs/pull/540) ([nfischer](https://github.com/nfischer)) - chore: add Node v7 for CI [\#539](https://github.com/shelljs/shelljs/pull/539) ([nfischer](https://github.com/nfischer)) ## [v0.7.5](https://github.com/shelljs/shelljs/tree/v0.7.5) (2016-10-27) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.4...v0.7.5) **Closed issues:** - Project objectives: there is some higher goal to achieve? [\#533](https://github.com/shelljs/shelljs/issues/533) - fs.existsSync is un-deprecated [\#531](https://github.com/shelljs/shelljs/issues/531) - Inadvertent breaking change to shell.test\(\) [\#529](https://github.com/shelljs/shelljs/issues/529) - Add -u flag support for cp [\#526](https://github.com/shelljs/shelljs/issues/526) - API request: allow `plugin.error\(\)` to take an options parameter [\#522](https://github.com/shelljs/shelljs/issues/522) - FS Real Path error thrown when requiring shelljs [\#521](https://github.com/shelljs/shelljs/issues/521) - Question: passing code via pipe? [\#520](https://github.com/shelljs/shelljs/issues/520) - The performance in `cp` is different between `0.6.0` and `0.7.4` [\#517](https://github.com/shelljs/shelljs/issues/517) - ShellJS in Electron package don't find ffmpeg anymore [\#516](https://github.com/shelljs/shelljs/issues/516) - Exec issues with string option introduced in 0.7.4 [\#515](https://github.com/shelljs/shelljs/issues/515) - \[ Feature \] SSH command [\#435](https://github.com/shelljs/shelljs/issues/435) **Merged pull requests:** - feat: plugin.error\(\) takes an options parameter [\#535](https://github.com/shelljs/shelljs/pull/535) ([nfischer](https://github.com/nfischer)) - Revert "refactor: replace fs.existsSync" fixes\(\#531\) [\#532](https://github.com/shelljs/shelljs/pull/532) ([gyandeeps](https://github.com/gyandeeps)) - Fix: Remove default glob from shell.test \(fixes \#529\) [\#530](https://github.com/shelljs/shelljs/pull/530) ([gyandeeps](https://github.com/gyandeeps)) - feat: cp -u option [\#527](https://github.com/shelljs/shelljs/pull/527) ([nfischer](https://github.com/nfischer)) - chore: add downloads per month on README [\#513](https://github.com/shelljs/shelljs/pull/513) ([nfischer](https://github.com/nfischer)) ## [v0.7.4](https://github.com/shelljs/shelljs/tree/v0.7.4) (2016-08-26) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.3...v0.7.4) **Closed issues:** - fix: echo -e should not print "-e" [\#510](https://github.com/shelljs/shelljs/issues/510) - Wrong method signature in doc [\#498](https://github.com/shelljs/shelljs/issues/498) - readFromPipe should be a function with no arguments [\#485](https://github.com/shelljs/shelljs/issues/485) - TypeError: Cannot read property 'toString' of undefined [\#471](https://github.com/shelljs/shelljs/issues/471) **Merged pull requests:** - fix: echo supports -e option properly [\#511](https://github.com/shelljs/shelljs/pull/511) ([nfischer](https://github.com/nfischer)) - refactor: replace fs.existsSync [\#509](https://github.com/shelljs/shelljs/pull/509) ([nfischer](https://github.com/nfischer)) - refactor: readFromPipe\(\) requires no arguments [\#506](https://github.com/shelljs/shelljs/pull/506) ([nfischer](https://github.com/nfischer)) - chore: switch to eslint [\#504](https://github.com/shelljs/shelljs/pull/504) ([nfischer](https://github.com/nfischer)) - feat: add overWrite option for commands [\#503](https://github.com/shelljs/shelljs/pull/503) ([nfischer](https://github.com/nfischer)) - chore: update issue template [\#502](https://github.com/shelljs/shelljs/pull/502) ([nfischer](https://github.com/nfischer)) - fixed head/tail readme [\#499](https://github.com/shelljs/shelljs/pull/499) ([charlesread](https://github.com/charlesread)) ## [v0.7.3](https://github.com/shelljs/shelljs/tree/v0.7.3) (2016-07-27) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.2...v0.7.3) **Closed issues:** - expose execSync [\#494](https://github.com/shelljs/shelljs/issues/494) - Add a way to create commands that can receive from a pipe without being standalone commands [\#487](https://github.com/shelljs/shelljs/issues/487) - cp -r breaks when the directory contains a softlink [\#193](https://github.com/shelljs/shelljs/issues/193) - Redirect output to file fails [\#60](https://github.com/shelljs/shelljs/issues/60) - We need sed -n ? [\#38](https://github.com/shelljs/shelljs/issues/38) **Merged pull requests:** - refactor: allow pipeOnly commands \(methods on ShellStrings\) [\#493](https://github.com/shelljs/shelljs/pull/493) ([nfischer](https://github.com/nfischer)) - refactor: glob by default for commands [\#492](https://github.com/shelljs/shelljs/pull/492) ([nfischer](https://github.com/nfischer)) - refactor: switch from notUnix to unix in wrap\(\) [\#491](https://github.com/shelljs/shelljs/pull/491) ([nfischer](https://github.com/nfischer)) - refactor: switch common.extend\(\) to Object.assign ponyfill [\#490](https://github.com/shelljs/shelljs/pull/490) ([nfischer](https://github.com/nfischer)) - fix: conflicting options now properly override each other [\#489](https://github.com/shelljs/shelljs/pull/489) ([nfischer](https://github.com/nfischer)) - refactor: expose plugin utils & add initial tests [\#484](https://github.com/shelljs/shelljs/pull/484) ([nfischer](https://github.com/nfischer)) ## [v0.7.2](https://github.com/shelljs/shelljs/tree/v0.7.2) (2016-07-25) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.1...v0.7.2) **Closed issues:** - shelljs should not kill process if node call throws exception [\#473](https://github.com/shelljs/shelljs/issues/473) - `cp` work incorrectly when folder name contains '@' [\#463](https://github.com/shelljs/shelljs/issues/463) - Something went wrong [\#158](https://github.com/shelljs/shelljs/issues/158) **Merged pull requests:** - fix: resolve a cylcic-dependency problem [\#482](https://github.com/shelljs/shelljs/pull/482) ([nfischer](https://github.com/nfischer)) - refactor: add wrapOutput option to auto-ShellString-ify command output [\#481](https://github.com/shelljs/shelljs/pull/481) ([nfischer](https://github.com/nfischer)) - refactor: move option parsing into common.wrap\(\) [\#479](https://github.com/shelljs/shelljs/pull/479) ([nfischer](https://github.com/nfischer)) - refactor: hook new uniq\(\) command using new format [\#478](https://github.com/shelljs/shelljs/pull/478) ([nfischer](https://github.com/nfischer)) - Fix mkdir malformed path [\#477](https://github.com/shelljs/shelljs/pull/477) ([nfischer](https://github.com/nfischer)) - fix: mkdir for invalid perms does not kill process [\#474](https://github.com/shelljs/shelljs/pull/474) ([nfischer](https://github.com/nfischer)) - feat\(command\): new command: uniq\(\) [\#453](https://github.com/shelljs/shelljs/pull/453) ([joshi-sh](https://github.com/joshi-sh)) ## [v0.7.1](https://github.com/shelljs/shelljs/tree/v0.7.1) (2016-07-22) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.7.0...v0.7.1) **Closed issues:** - cp -n doesn't work correctly [\#465](https://github.com/shelljs/shelljs/issues/465) - how can i run sudo apt-get install xtodotool by your plugin? [\#448](https://github.com/shelljs/shelljs/issues/448) - shell.js grep: internal error, Invalid regular expression [\#447](https://github.com/shelljs/shelljs/issues/447) - Stdout is empty on Git log command [\#439](https://github.com/shelljs/shelljs/issues/439) - Cannot read toString of null when using execSync [\#415](https://github.com/shelljs/shelljs/issues/415) - cp -R dir/ target fails to copy hidden files in dir [\#140](https://github.com/shelljs/shelljs/issues/140) - \#mv Won't Work Across Disks [\#1](https://github.com/shelljs/shelljs/issues/1) **Merged pull requests:** - refactor: commands now register themselves [\#475](https://github.com/shelljs/shelljs/pull/475) ([nfischer](https://github.com/nfischer)) - chore: switch to shields.io, and add npm badge [\#470](https://github.com/shelljs/shelljs/pull/470) ([nfischer](https://github.com/nfischer)) - fix\(cp\): -n option no longer raises error [\#466](https://github.com/shelljs/shelljs/pull/466) ([nfischer](https://github.com/nfischer)) - refactor: expose pipe-ability to command configuration [\#464](https://github.com/shelljs/shelljs/pull/464) ([nfischer](https://github.com/nfischer)) - fix\(mv\): works across partitions [\#461](https://github.com/shelljs/shelljs/pull/461) ([nfischer](https://github.com/nfischer)) - chore: switch to shelljs-changelog [\#460](https://github.com/shelljs/shelljs/pull/460) ([nfischer](https://github.com/nfischer)) - chore: update release process [\#459](https://github.com/shelljs/shelljs/pull/459) ([nfischer](https://github.com/nfischer)) - chore: revert depreciate shelljs/make \(\#431\) [\#458](https://github.com/shelljs/shelljs/pull/458) ([zephraph](https://github.com/zephraph)) - chore: clarify message for when docs are not generated [\#457](https://github.com/shelljs/shelljs/pull/457) ([nfischer](https://github.com/nfischer)) - chore\(gendocs\): add `npm run gendocs` command [\#455](https://github.com/shelljs/shelljs/pull/455) ([nfischer](https://github.com/nfischer)) - chore: update jshint and move it to an npm script [\#454](https://github.com/shelljs/shelljs/pull/454) ([nfischer](https://github.com/nfischer)) - test\(ls\): add case for trailing slash on dir name [\#450](https://github.com/shelljs/shelljs/pull/450) ([nfischer](https://github.com/nfischer)) - docs\(exec\): explicitly mention the `shell` option [\#449](https://github.com/shelljs/shelljs/pull/449) ([nfischer](https://github.com/nfischer)) - chore: setup changelog [\#443](https://github.com/shelljs/shelljs/pull/443) ([levithomason](https://github.com/levithomason)) - docs: comment code better to help contributors [\#437](https://github.com/shelljs/shelljs/pull/437) ([nfischer](https://github.com/nfischer)) - chore\(CI\): update appveyor [\#436](https://github.com/shelljs/shelljs/pull/436) ([nfischer](https://github.com/nfischer)) - chore: test against node v6 [\#433](https://github.com/shelljs/shelljs/pull/433) ([nfischer](https://github.com/nfischer)) - docs: warn that README contains newest features [\#410](https://github.com/shelljs/shelljs/pull/410) ([nfischer](https://github.com/nfischer)) ## [v0.7.0](https://github.com/shelljs/shelljs/tree/v0.7.0) (2016-04-25) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.6.0...v0.7.0) **Closed issues:** - exec\('nohup node some.js &'\) [\#426](https://github.com/shelljs/shelljs/issues/426) - shelljs Breaks SemVer for Alpha and Pre-Release Versions [\#390](https://github.com/shelljs/shelljs/issues/390) - Copy not accepting source end with wildcards \* when using -r on v0.6.0 [\#389](https://github.com/shelljs/shelljs/issues/389) - Support globbing in `shjs` [\#388](https://github.com/shelljs/shelljs/issues/388) - Refactor more commands to return ShellString [\#373](https://github.com/shelljs/shelljs/issues/373) - ln\('-sf', './', '\'\) is not linking the right folder [\#363](https://github.com/shelljs/shelljs/issues/363) - v0.6.0 - shell.cp\('r', '/foo/\*, '/bar'\) fails with /foo/\* no such file or directory [\#342](https://github.com/shelljs/shelljs/issues/342) - Add documentup as a webhook [\#327](https://github.com/shelljs/shelljs/issues/327) - Dir glob breaks when in the middle of path [\#245](https://github.com/shelljs/shelljs/issues/245) - could you switch off wiki page? [\#233](https://github.com/shelljs/shelljs/issues/233) - ls globbing does not behave like shell, consider using glob.sync [\#225](https://github.com/shelljs/shelljs/issues/225) - Cannot run shell.exec\('heroku config:push'\) -- just hangs [\#218](https://github.com/shelljs/shelljs/issues/218) - `cp` does not overwrite files by default [\#210](https://github.com/shelljs/shelljs/issues/210) - exec failed to return [\#208](https://github.com/shelljs/shelljs/issues/208) - CLI Version [\#202](https://github.com/shelljs/shelljs/issues/202) - Bracket expansion not working [\#176](https://github.com/shelljs/shelljs/issues/176) - "exec" causes LiveScript interpreter \(lsc\) to hang [\#160](https://github.com/shelljs/shelljs/issues/160) - Don't modify string prototype [\#159](https://github.com/shelljs/shelljs/issues/159) - `exec\(...\).to\(file\)` should work [\#154](https://github.com/shelljs/shelljs/issues/154) - Can't install shelljs locally instead of globally [\#136](https://github.com/shelljs/shelljs/issues/136) - shelljs and node 0.10.28 [\#125](https://github.com/shelljs/shelljs/issues/125) - Use case for global installed shelljs [\#123](https://github.com/shelljs/shelljs/issues/123) - Only get stdout from `exec` [\#92](https://github.com/shelljs/shelljs/issues/92) - What about other commands? [\#90](https://github.com/shelljs/shelljs/issues/90) - Flesh out example of exit\(\) [\#73](https://github.com/shelljs/shelljs/issues/73) - exec doesn't work with qualified paths on windows [\#41](https://github.com/shelljs/shelljs/issues/41) - exec does not working in mingw bash in windows [\#17](https://github.com/shelljs/shelljs/issues/17) - Add support for cp -P option [\#413](https://github.com/shelljs/shelljs/issues/413) - cp -L: Incorrect behavior for symlinks to regular files [\#407](https://github.com/shelljs/shelljs/issues/407) - Edit the docs to emphasize ShellStrings and Pipes [\#398](https://github.com/shelljs/shelljs/issues/398) - Error message isn't always printed [\#372](https://github.com/shelljs/shelljs/issues/372) - Standardize command output [\#356](https://github.com/shelljs/shelljs/issues/356) - exec\(\) doesn't clean up all temp files [\#353](https://github.com/shelljs/shelljs/issues/353) - Document that exec\(\) options don't work on early versions of node [\#350](https://github.com/shelljs/shelljs/issues/350) - Add -f option to set\(\) [\#344](https://github.com/shelljs/shelljs/issues/344) - Glob commands by default [\#343](https://github.com/shelljs/shelljs/issues/343) - rm -rf incorrect behaviour [\#332](https://github.com/shelljs/shelljs/issues/332) - Switch `exec\(\)` to use bash by default [\#281](https://github.com/shelljs/shelljs/issues/281) - pipe to proc [\#148](https://github.com/shelljs/shelljs/issues/148) - shell builtin [\#138](https://github.com/shelljs/shelljs/issues/138) - add timeout option for exec [\#132](https://github.com/shelljs/shelljs/issues/132) - shelljs cp handling symlinks badly [\#69](https://github.com/shelljs/shelljs/issues/69) **Merged pull requests:** - chore: add "Team" section to README [\#423](https://github.com/shelljs/shelljs/pull/423) ([nfischer](https://github.com/nfischer)) - Contributing guidelines [\#422](https://github.com/shelljs/shelljs/pull/422) ([nfischer](https://github.com/nfischer)) - feat\(glob\): expose config.globOptions. [\#400](https://github.com/shelljs/shelljs/pull/400) ([nfischer](https://github.com/nfischer)) - Add shelljs as a keyword in package.json [\#393](https://github.com/shelljs/shelljs/pull/393) ([nfischer](https://github.com/nfischer)) - docs: add link to wiki page [\#392](https://github.com/shelljs/shelljs/pull/392) ([nfischer](https://github.com/nfischer)) - refactor\(cd\): use process.env.OLDPWD to store previous dir [\#383](https://github.com/shelljs/shelljs/pull/383) ([nfischer](https://github.com/nfischer)) - chore\(appveyor\): add in node 4 for appveyor [\#381](https://github.com/shelljs/shelljs/pull/381) ([nfischer](https://github.com/nfischer)) - Add Cash cross-reference [\#375](https://github.com/shelljs/shelljs/pull/375) ([dthree](https://github.com/dthree)) - Ignore gitattributes from npm package [\#361](https://github.com/shelljs/shelljs/pull/361) ([nfischer](https://github.com/nfischer)) - Consistently use LF line endings [\#355](https://github.com/shelljs/shelljs/pull/355) ([TimothyGu](https://github.com/TimothyGu)) - Release v0.7.0 [\#429](https://github.com/shelljs/shelljs/pull/429) ([nfischer](https://github.com/nfischer)) - fix: null is no longer confused for an object [\#428](https://github.com/shelljs/shelljs/pull/428) ([nfischer](https://github.com/nfischer)) - fix\(ls\): no trailing newline for empty directories [\#425](https://github.com/shelljs/shelljs/pull/425) ([nfischer](https://github.com/nfischer)) - feat\(cp\): -P option, plus better handling of symlinks [\#421](https://github.com/shelljs/shelljs/pull/421) ([nfischer](https://github.com/nfischer)) - docs\(exec\): fix docs about exec return type [\#419](https://github.com/shelljs/shelljs/pull/419) ([nfischer](https://github.com/nfischer)) - docs\(error\): deprecate relying on string value [\#418](https://github.com/shelljs/shelljs/pull/418) ([nfischer](https://github.com/nfischer)) - fix: error message now printed for fatal failures [\#417](https://github.com/shelljs/shelljs/pull/417) ([nfischer](https://github.com/nfischer)) - issue-407: Add regular files unit tests and fix symlink copy behavior [\#409](https://github.com/shelljs/shelljs/pull/409) ([charlesverge](https://github.com/charlesverge)) - refactor\(rm\): Remove duplicate code [\#408](https://github.com/shelljs/shelljs/pull/408) ([nfischer](https://github.com/nfischer)) - docs: wildcards for all commands, other docs cleanups [\#404](https://github.com/shelljs/shelljs/pull/404) ([nfischer](https://github.com/nfischer)) - test\(rm\): add tests to prevent a future regression [\#403](https://github.com/shelljs/shelljs/pull/403) ([nfischer](https://github.com/nfischer)) - refactor\(string\): modify string protoype, but only for shelljs/global [\#401](https://github.com/shelljs/shelljs/pull/401) ([nfischer](https://github.com/nfischer)) - feat: adding error codes to ShellJS [\#394](https://github.com/shelljs/shelljs/pull/394) ([nfischer](https://github.com/nfischer)) - feature: use rechoir [\#384](https://github.com/shelljs/shelljs/pull/384) ([nfischer](https://github.com/nfischer)) - refactor\(cp\): clean up code and fix \#376 [\#380](https://github.com/shelljs/shelljs/pull/380) ([nfischer](https://github.com/nfischer)) - New commands: sort\(\), head\(\), and tail\(\) [\#379](https://github.com/shelljs/shelljs/pull/379) ([nfischer](https://github.com/nfischer)) - Add unit tests to prevent regression \(see \#376\) [\#378](https://github.com/shelljs/shelljs/pull/378) ([nfischer](https://github.com/nfischer)) - feat\(pipe\): add support for pipes between commands [\#370](https://github.com/shelljs/shelljs/pull/370) ([nfischer](https://github.com/nfischer)) - refactor\(ls\): greatly simplify ls implimentation [\#369](https://github.com/shelljs/shelljs/pull/369) ([ariporad](https://github.com/ariporad)) - chore: drop node v0.10 support [\#368](https://github.com/shelljs/shelljs/pull/368) ([ariporad](https://github.com/ariporad)) - perf\(cd\): only run `stat` once [\#367](https://github.com/shelljs/shelljs/pull/367) ([ariporad](https://github.com/ariporad)) - fix\(exec\): properly handles paths with spaces and quotes [\#365](https://github.com/shelljs/shelljs/pull/365) ([nfischer](https://github.com/nfischer)) - test\(ln\): add tests for linking to cwd [\#364](https://github.com/shelljs/shelljs/pull/364) ([nfischer](https://github.com/nfischer)) - fix\(verbose\): verbose-style logging is consistent [\#362](https://github.com/shelljs/shelljs/pull/362) ([nfischer](https://github.com/nfischer)) - Refactor shellstring [\#360](https://github.com/shelljs/shelljs/pull/360) ([nfischer](https://github.com/nfischer)) - feat\(glob\): use glob module for globbing [\#359](https://github.com/shelljs/shelljs/pull/359) ([nfischer](https://github.com/nfischer)) - feat\(set\): add -f option to disable globbing [\#358](https://github.com/shelljs/shelljs/pull/358) ([nfischer](https://github.com/nfischer)) - config.fatal now throws an exception [\#357](https://github.com/shelljs/shelljs/pull/357) ([jrmclaurin](https://github.com/jrmclaurin)) - fix\(exec\): temp files are now cleaned up [\#354](https://github.com/shelljs/shelljs/pull/354) ([nfischer](https://github.com/nfischer)) - feat\(glob\): glob support for \(almost\) all commands [\#352](https://github.com/shelljs/shelljs/pull/352) ([nfischer](https://github.com/nfischer)) - feat\(grep\): add -l option [\#349](https://github.com/shelljs/shelljs/pull/349) ([nfischer](https://github.com/nfischer)) - fix\(exec\): now actually supports shell option [\#348](https://github.com/shelljs/shelljs/pull/348) ([nfischer](https://github.com/nfischer)) - feat\(touch\): supports multiple files [\#346](https://github.com/shelljs/shelljs/pull/346) ([nfischer](https://github.com/nfischer)) ## [v0.6.0](https://github.com/shelljs/shelljs/tree/v0.6.0) (2016-02-05) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.5.3...v0.6.0) **Closed issues:** - option not recognized [\#334](https://github.com/shelljs/shelljs/issues/334) - Feature request: Metadata with `ls` [\#323](https://github.com/shelljs/shelljs/issues/323) - Gen-docs is broken [\#309](https://github.com/shelljs/shelljs/issues/309) - `link -s` is broken for files on Windows [\#301](https://github.com/shelljs/shelljs/issues/301) - Shelljs quits unexpectedly: [\#300](https://github.com/shelljs/shelljs/issues/300) - Failing tests on Windows [\#296](https://github.com/shelljs/shelljs/issues/296) - run-tests.js is broken for cmd.exe [\#294](https://github.com/shelljs/shelljs/issues/294) - Support echo-ing environment variables [\#291](https://github.com/shelljs/shelljs/issues/291) - Add Windows CI [\#287](https://github.com/shelljs/shelljs/issues/287) - Add tests for the shjs utility [\#280](https://github.com/shelljs/shelljs/issues/280) - Allow shjs utility to infer the extension for "filename." [\#278](https://github.com/shelljs/shelljs/issues/278) - Ability to read the stdout buffer line-by-line [\#277](https://github.com/shelljs/shelljs/issues/277) - Poor output for commands with multiple errors [\#267](https://github.com/shelljs/shelljs/issues/267) - Travis ci build status says "unknown" [\#266](https://github.com/shelljs/shelljs/issues/266) - wild card characters in filename not working as expected [\#262](https://github.com/shelljs/shelljs/issues/262) - shell.exec - read internal variable [\#260](https://github.com/shelljs/shelljs/issues/260) - cp and rename directory with -r doesn't match unix behavior [\#256](https://github.com/shelljs/shelljs/issues/256) - console.log.apply throwing TypeError: Illegal Invocation [\#255](https://github.com/shelljs/shelljs/issues/255) - How to exit on first error [\#253](https://github.com/shelljs/shelljs/issues/253) - why not support set 'cwd' when invoke execAsync ? [\#250](https://github.com/shelljs/shelljs/issues/250) - Not possible to check the failure of cd? [\#247](https://github.com/shelljs/shelljs/issues/247) - By default shelljs runs command in root [\#246](https://github.com/shelljs/shelljs/issues/246) - /usr/bin/env: node: No such file or directory [\#243](https://github.com/shelljs/shelljs/issues/243) - "Which" command not working properly on Windows Platform. [\#238](https://github.com/shelljs/shelljs/issues/238) - Arguments [\#237](https://github.com/shelljs/shelljs/issues/237) - sed\(\) should accept multiple file arguments [\#231](https://github.com/shelljs/shelljs/issues/231) - shelljs.exec\('aaa && bbb'\) blocks [\#229](https://github.com/shelljs/shelljs/issues/229) - Consider creating a GitHub Organization with more maintainers [\#223](https://github.com/shelljs/shelljs/issues/223) - \[idea\] Add chmodr function. [\#219](https://github.com/shelljs/shelljs/issues/219) - Execute a file [\#211](https://github.com/shelljs/shelljs/issues/211) - Where is standard error going to? [\#209](https://github.com/shelljs/shelljs/issues/209) - boolean return value for string.to\(\) [\#205](https://github.com/shelljs/shelljs/issues/205) - `common.error` doesn't throw [\#199](https://github.com/shelljs/shelljs/issues/199) - Problems with exec \(sync\) on 0.12/io.js [\#197](https://github.com/shelljs/shelljs/issues/197) - cp --update flag [\#172](https://github.com/shelljs/shelljs/issues/172) - Is there a way to suppress pushd/popd output? [\#171](https://github.com/shelljs/shelljs/issues/171) - Cannot recursively list all \*.js files [\#162](https://github.com/shelljs/shelljs/issues/162) - exec\(\) breaks if executed in a deleted directory [\#157](https://github.com/shelljs/shelljs/issues/157) - shjs command always exits with zero code [\#133](https://github.com/shelljs/shelljs/issues/133) - touch command [\#122](https://github.com/shelljs/shelljs/issues/122) - Symbolic links are broken! [\#100](https://github.com/shelljs/shelljs/issues/100) - interpret `--` as stdin [\#55](https://github.com/shelljs/shelljs/issues/55) - Error ENOTEMPTY when deleting a directory recursively. [\#49](https://github.com/shelljs/shelljs/issues/49) - Cross-platform way to add to PATH [\#32](https://github.com/shelljs/shelljs/issues/32) - `mv` fails on block, character, fifo [\#25](https://github.com/shelljs/shelljs/issues/25) - ls -l [\#22](https://github.com/shelljs/shelljs/issues/22) **Merged pull requests:** - feat\(set\): add new set\(\) command [\#329](https://github.com/shelljs/shelljs/pull/329) ([nfischer](https://github.com/nfischer)) - Fix symlinking on Windows [\#322](https://github.com/shelljs/shelljs/pull/322) ([BYK](https://github.com/BYK)) - Rewrite .gitignore to be more comprehensive [\#321](https://github.com/shelljs/shelljs/pull/321) ([BYK](https://github.com/BYK)) - chore\(gitter/travis\): add gitter webhook to travis [\#313](https://github.com/shelljs/shelljs/pull/313) ([ariporad](https://github.com/ariporad)) - chore\(LGTM\): add LGTM config files [\#312](https://github.com/shelljs/shelljs/pull/312) ([ariporad](https://github.com/ariporad)) - feat\(ls\): add -d flag to ls\(\) [\#311](https://github.com/shelljs/shelljs/pull/311) ([nfischer](https://github.com/nfischer)) - fix\(gen-docs\): fix issue where docs are generated wrong [\#310](https://github.com/shelljs/shelljs/pull/310) ([nfischer](https://github.com/nfischer)) - chore\(package\): remove v0.8 from engines list [\#308](https://github.com/shelljs/shelljs/pull/308) ([nfischer](https://github.com/nfischer)) - travis: Mark as not using `sudo` and do not test 0.11 [\#307](https://github.com/shelljs/shelljs/pull/307) ([TimothyGu](https://github.com/TimothyGu)) - fix: jshint works on Windows [\#295](https://github.com/shelljs/shelljs/pull/295) ([nfischer](https://github.com/nfischer)) - feat: add tilde expansion to expand\(\) [\#293](https://github.com/shelljs/shelljs/pull/293) ([nfischer](https://github.com/nfischer)) - style: make docs more consistent [\#292](https://github.com/shelljs/shelljs/pull/292) ([nfischer](https://github.com/nfischer)) - update `exec` docs to match implemented behaviour [\#289](https://github.com/shelljs/shelljs/pull/289) ([vise890](https://github.com/vise890)) - chore: update github URL in package.json [\#288](https://github.com/shelljs/shelljs/pull/288) ([nfischer](https://github.com/nfischer)) - docs\(spelling\): fix typo in source comment [\#285](https://github.com/shelljs/shelljs/pull/285) ([nfischer](https://github.com/nfischer)) - chore\(travis\): add OS X to Travis CI [\#283](https://github.com/shelljs/shelljs/pull/283) ([nfischer](https://github.com/nfischer)) - Don't do `console.log.apply\(this, ...\)`. [\#274](https://github.com/shelljs/shelljs/pull/274) ([ariporad](https://github.com/ariporad)) - Implementing cd\('-'\) to behave like Bash's "cd -" [\#273](https://github.com/shelljs/shelljs/pull/273) ([nfischer](https://github.com/nfischer)) - Fix cp to match unix behavior [\#271](https://github.com/shelljs/shelljs/pull/271) ([freitagbr](https://github.com/freitagbr)) - Commands that have multiple errors now produce cleaner log output [\#268](https://github.com/shelljs/shelljs/pull/268) ([nfischer](https://github.com/nfischer)) - Support exit code in shjs. [\#252](https://github.com/shelljs/shelljs/pull/252) ([bryce-gibson](https://github.com/bryce-gibson)) - add touch\(1\) [\#249](https://github.com/shelljs/shelljs/pull/249) ([blockloop](https://github.com/blockloop)) - Fix `os.tmpdir` bug [\#240](https://github.com/shelljs/shelljs/pull/240) ([BYK](https://github.com/BYK)) - Make sure Which\(\) on Windows platform always return the command with … [\#239](https://github.com/shelljs/shelljs/pull/239) ([TingluoHuang](https://github.com/TingluoHuang)) - Add target node.js \(iojs v1, v2, v3\) [\#230](https://github.com/shelljs/shelljs/pull/230) ([sanemat](https://github.com/sanemat)) - feat-multisymbolic + Support for directory entry \(capital X in chmod terms\) [\#228](https://github.com/shelljs/shelljs/pull/228) ([rezonant](https://github.com/rezonant)) - Fixes an issue with multi-symbolic mode specification \(ie a-rwx,u+rw\) [\#227](https://github.com/shelljs/shelljs/pull/227) ([rezonant](https://github.com/rezonant)) - Memoized the result of target invocation [\#216](https://github.com/shelljs/shelljs/pull/216) ([rizowski](https://github.com/rizowski)) - remove empty for loop and leaked i var [\#166](https://github.com/shelljs/shelljs/pull/166) ([ratbeard](https://github.com/ratbeard)) - Wrap script name in double quotes [\#135](https://github.com/shelljs/shelljs/pull/135) ([ndelitski](https://github.com/ndelitski)) - Fixed coffeescript syntax in top example [\#99](https://github.com/shelljs/shelljs/pull/99) ([maxnordlund](https://github.com/maxnordlund)) - fix\(touch\): enhance parseOptions and fix touch's -r flag [\#341](https://github.com/shelljs/shelljs/pull/341) ([nfischer](https://github.com/nfischer)) - chore\(.npmignore\): update npmignore [\#339](https://github.com/shelljs/shelljs/pull/339) ([ariporad](https://github.com/ariporad)) - Release v0.6.0 [\#338](https://github.com/shelljs/shelljs/pull/338) ([ariporad](https://github.com/ariporad)) - docs\(README\): remove coffeescript from README [\#337](https://github.com/shelljs/shelljs/pull/337) ([ariporad](https://github.com/ariporad)) - fix\(cp\): add -n option, make -f default behavior [\#336](https://github.com/shelljs/shelljs/pull/336) ([nfischer](https://github.com/nfischer)) - feat\(exec\): allow all exec options to pass through [\#335](https://github.com/shelljs/shelljs/pull/335) ([nfischer](https://github.com/nfischer)) - fix\(mv\): add -n option, make -f default behavior [\#328](https://github.com/shelljs/shelljs/pull/328) ([nfischer](https://github.com/nfischer)) - fix\(cat\): make behavior more like unix [\#326](https://github.com/shelljs/shelljs/pull/326) ([nfischer](https://github.com/nfischer)) - feat\(ls\): add -l option [\#324](https://github.com/shelljs/shelljs/pull/324) ([nfischer](https://github.com/nfischer)) - style\(test/which\): make test/which.js conform to the style guidelines [\#320](https://github.com/shelljs/shelljs/pull/320) ([ariporad](https://github.com/ariporad)) - chore\(appveyor\): add badge [\#316](https://github.com/shelljs/shelljs/pull/316) ([nfischer](https://github.com/nfischer)) - fix\(windows\): fix shjs commands for windows [\#315](https://github.com/shelljs/shelljs/pull/315) ([nfischer](https://github.com/nfischer)) - feat\(sed\): support multiple file names [\#314](https://github.com/shelljs/shelljs/pull/314) ([nfischer](https://github.com/nfischer)) - feat\(cd\): cd\(\) \(no args\) changes to home directory [\#306](https://github.com/shelljs/shelljs/pull/306) ([nfischer](https://github.com/nfischer)) - test\(shjs\): add tests for shjs [\#304](https://github.com/shelljs/shelljs/pull/304) ([ariporad](https://github.com/ariporad)) - fix: regexes are more consistent with sed and grep [\#303](https://github.com/shelljs/shelljs/pull/303) ([nfischer](https://github.com/nfischer)) - Add appveyor.yml config file [\#299](https://github.com/shelljs/shelljs/pull/299) ([nfischer](https://github.com/nfischer)) - Fix tests on Windows [\#297](https://github.com/shelljs/shelljs/pull/297) ([BYK](https://github.com/BYK)) - Search PATHEXT instead of 3 hardcoded values [\#290](https://github.com/shelljs/shelljs/pull/290) ([isiahmeadows](https://github.com/isiahmeadows)) - Fix relative symlinks [\#282](https://github.com/shelljs/shelljs/pull/282) ([freitagbr](https://github.com/freitagbr)) - Make to and toEnd chainable [\#276](https://github.com/shelljs/shelljs/pull/276) ([TimothyGu](https://github.com/TimothyGu)) ## [v0.5.3](https://github.com/shelljs/shelljs/tree/v0.5.3) (2015-08-11) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.5.2...v0.5.3) **Merged pull requests:** - Manually closing streams [\#222](https://github.com/shelljs/shelljs/pull/222) ([JulianLaval](https://github.com/JulianLaval)) ## [v0.5.2](https://github.com/shelljs/shelljs/tree/v0.5.2) (2015-08-10) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.5.1...v0.5.2) **Closed issues:** - Cannot run shell.exec [\#217](https://github.com/shelljs/shelljs/issues/217) - write after end: internal error [\#206](https://github.com/shelljs/shelljs/issues/206) **Merged pull requests:** - Update README.md [\#221](https://github.com/shelljs/shelljs/pull/221) ([giosh94mhz](https://github.com/giosh94mhz)) - prevent internal error: write after end [\#214](https://github.com/shelljs/shelljs/pull/214) ([charlierudolph](https://github.com/charlierudolph)) ## [v0.5.1](https://github.com/shelljs/shelljs/tree/v0.5.1) (2015-06-05) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.5.0...v0.5.1) **Closed issues:** - cd into home directory [\#9](https://github.com/shelljs/shelljs/issues/9) **Merged pull requests:** - Fix issue \#49: Retry rmdirSync on Windows for up to 1 second if files still exist. [\#179](https://github.com/shelljs/shelljs/pull/179) ([andreialecu](https://github.com/andreialecu)) ## [v0.5.0](https://github.com/shelljs/shelljs/tree/v0.5.0) (2015-05-19) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.3.0...v0.5.0) **Closed issues:** - Enter text to prompt [\#203](https://github.com/shelljs/shelljs/issues/203) - Find which shell is being used [\#195](https://github.com/shelljs/shelljs/issues/195) - Pass command line params to the make tool [\#188](https://github.com/shelljs/shelljs/issues/188) - Is it possible to call exec with a command containing new lines ? [\#177](https://github.com/shelljs/shelljs/issues/177) - The installation would break on Windows 7 [\#161](https://github.com/shelljs/shelljs/issues/161) - Q.ninvoke\(\) returns undefined [\#153](https://github.com/shelljs/shelljs/issues/153) - installed shelljs on osx but reported error: npm ERR! 404 '%5B-g%5D' is not in the npm registry. [\#124](https://github.com/shelljs/shelljs/issues/124) - "ln" not found \(OS X\) [\#106](https://github.com/shelljs/shelljs/issues/106) - Using shelljs in a CLI app. [\#91](https://github.com/shelljs/shelljs/issues/91) **Merged pull requests:** - Breaking: Allow -- as args separators \(fixes \#188\) [\#207](https://github.com/shelljs/shelljs/pull/207) ([nzakas](https://github.com/nzakas)) - Update .travis.yml [\#190](https://github.com/shelljs/shelljs/pull/190) ([arturadib](https://github.com/arturadib)) - Use new child\_process.execSync instead of busywaiting [\#189](https://github.com/shelljs/shelljs/pull/189) ([madd512](https://github.com/madd512)) - Update README.md: explains how to access "config" [\#145](https://github.com/shelljs/shelljs/pull/145) ([kerphi](https://github.com/kerphi)) - Fix to set state.error before throw the exception [\#120](https://github.com/shelljs/shelljs/pull/120) ([abdul-martinez](https://github.com/abdul-martinez)) - Add -l and -s support to grep. [\#116](https://github.com/shelljs/shelljs/pull/116) ([idearat](https://github.com/idearat)) ## [v0.3.0](https://github.com/shelljs/shelljs/tree/v0.3.0) (2014-05-08) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.2.6...v0.3.0) **Closed issues:** - grep\(\) should fully support globing [\#118](https://github.com/shelljs/shelljs/issues/118) - sed\(\) could support replacement function [\#115](https://github.com/shelljs/shelljs/issues/115) - How would you close an exec process that runs indefinitely? [\#113](https://github.com/shelljs/shelljs/issues/113) - listen for intermittent output of a long-running child process [\#111](https://github.com/shelljs/shelljs/issues/111) - Cannot find module 'shelljs' after installing shelljs with npm [\#109](https://github.com/shelljs/shelljs/issues/109) - Massive CPU usage on exec\(\) windows [\#108](https://github.com/shelljs/shelljs/issues/108) - cp skipping dot files? [\#79](https://github.com/shelljs/shelljs/issues/79) - $variables in exec\(\) aren't handled correctly [\#11](https://github.com/shelljs/shelljs/issues/11) - debug flag that prints commands instead of executing [\#8](https://github.com/shelljs/shelljs/issues/8) **Merged pull requests:** - grep\(\) support for globing, fixes \#118 [\#119](https://github.com/shelljs/shelljs/pull/119) ([utensil](https://github.com/utensil)) - make sed\(\) support replacement function, fixes \#115 [\#117](https://github.com/shelljs/shelljs/pull/117) ([utensil](https://github.com/utensil)) - which\(\) should only find files, not directories [\#110](https://github.com/shelljs/shelljs/pull/110) ([panrafal](https://github.com/panrafal)) - Added the New BSD license to the package.json. [\#105](https://github.com/shelljs/shelljs/pull/105) ([keskival](https://github.com/keskival)) - Added win32 support to ln [\#104](https://github.com/shelljs/shelljs/pull/104) ([jamon](https://github.com/jamon)) - Fix ln using bad paths when given abspaths. [\#89](https://github.com/shelljs/shelljs/pull/89) ([Schoonology](https://github.com/Schoonology)) - Add ln support, including both -s and -f options. [\#88](https://github.com/shelljs/shelljs/pull/88) ([Schoonology](https://github.com/Schoonology)) - add support for symlinking \(junctions\) on win32 [\#87](https://github.com/shelljs/shelljs/pull/87) ([jamon](https://github.com/jamon)) ## [v0.2.6](https://github.com/shelljs/shelljs/tree/v0.2.6) (2013-09-22) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.2.5...v0.2.6) **Closed issues:** - Versions 0.2.4 and 0.2.3 keep throwing strange errors [\#82](https://github.com/shelljs/shelljs/issues/82) - Add global pollution tests [\#33](https://github.com/shelljs/shelljs/issues/33) ## [v0.2.5](https://github.com/shelljs/shelljs/tree/v0.2.5) (2013-09-11) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.2.4...v0.2.5) **Closed issues:** - shelljs.exec stalls on Red Hat when script is invoked with 'sudo -u username' [\#72](https://github.com/shelljs/shelljs/issues/72) ## [v0.2.4](https://github.com/shelljs/shelljs/tree/v0.2.4) (2013-09-11) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.2.3...v0.2.4) ## [v0.2.3](https://github.com/shelljs/shelljs/tree/v0.2.3) (2013-09-09) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.2.2...v0.2.3) **Merged pull requests:** - Make shell.exec\(\) treat process error return codes as shelljs errors [\#80](https://github.com/shelljs/shelljs/pull/80) ([nilsbunger](https://github.com/nilsbunger)) ## [v0.2.2](https://github.com/shelljs/shelljs/tree/v0.2.2) (2013-09-02) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.1.4...v0.2.2) **Closed issues:** - which and node\_modules [\#63](https://github.com/shelljs/shelljs/issues/63) - cannot install with nodejs 0.10.2 [\#57](https://github.com/shelljs/shelljs/issues/57) **Merged pull requests:** - Addition of a toEnd\(\) function modeled after the Unix \>\> pipe. [\#78](https://github.com/shelljs/shelljs/pull/78) ([a10y](https://github.com/a10y)) - Added appendTo\(\) function to imitate '\>\>' redirect-and-append pipe. [\#75](https://github.com/shelljs/shelljs/pull/75) ([a10y](https://github.com/a10y)) - Fix a small typo in README.md [\#71](https://github.com/shelljs/shelljs/pull/71) ([asmblah](https://github.com/asmblah)) - adding an `.npmignore` file [\#70](https://github.com/shelljs/shelljs/pull/70) ([stephenmathieson](https://github.com/stephenmathieson)) - tempdir: use `os.tmpDir` when possible [\#67](https://github.com/shelljs/shelljs/pull/67) ([stephenmathieson](https://github.com/stephenmathieson)) ## [v0.1.4](https://github.com/shelljs/shelljs/tree/v0.1.4) (2013-05-10) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.1.3...v0.1.4) **Merged pull requests:** - removing extra fs calls [\#62](https://github.com/shelljs/shelljs/pull/62) ([stephenmathieson](https://github.com/stephenmathieson)) - moving \_jshint\_ to a development dependency [\#61](https://github.com/shelljs/shelljs/pull/61) ([stephenmathieson](https://github.com/stephenmathieson)) - Make the maximum buffersize 20 MB. [\#59](https://github.com/shelljs/shelljs/pull/59) ([waddlesplash](https://github.com/waddlesplash)) ## [v0.1.3](https://github.com/shelljs/shelljs/tree/v0.1.3) (2013-04-21) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.1.2...v0.1.3) **Merged pull requests:** - test\('-L', badlink\) should return true [\#56](https://github.com/shelljs/shelljs/pull/56) ([lge88](https://github.com/lge88)) - exec options now allows `silent:true` with callback. [\#54](https://github.com/shelljs/shelljs/pull/54) ([iapain](https://github.com/iapain)) - Add Zepto to README [\#53](https://github.com/shelljs/shelljs/pull/53) ([madrobby](https://github.com/madrobby)) ## [v0.1.2](https://github.com/shelljs/shelljs/tree/v0.1.2) (2013-01-08) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.1.1...v0.1.2) **Closed issues:** - pushd/popd [\#24](https://github.com/shelljs/shelljs/issues/24) **Merged pull requests:** - Implemented chmod command. Github issue 35 [\#48](https://github.com/shelljs/shelljs/pull/48) ([brandonramirez](https://github.com/brandonramirez)) ## [v0.1.1](https://github.com/shelljs/shelljs/tree/v0.1.1) (2013-01-01) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.1.0...v0.1.1) **Merged pull requests:** - Work in progress: pushd/popd/dirs [\#47](https://github.com/shelljs/shelljs/pull/47) ([mstade](https://github.com/mstade)) ## [v0.1.0](https://github.com/shelljs/shelljs/tree/v0.1.0) (2012-12-26) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.9...v0.1.0) **Closed issues:** - test\(\) for binary file? [\#45](https://github.com/shelljs/shelljs/issues/45) - Inconsistent behaviour of cp command with directories. [\#44](https://github.com/shelljs/shelljs/issues/44) - Executing SSH with ShellJs [\#43](https://github.com/shelljs/shelljs/issues/43) **Merged pull requests:** - Fix for \#44 [\#46](https://github.com/shelljs/shelljs/pull/46) ([mstade](https://github.com/mstade)) - Fix single/double quotes in exec [\#42](https://github.com/shelljs/shelljs/pull/42) ([danielepolencic](https://github.com/danielepolencic)) ## [v0.0.9](https://github.com/shelljs/shelljs/tree/v0.0.9) (2012-12-01) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.8...v0.0.9) **Closed issues:** - silent output [\#40](https://github.com/shelljs/shelljs/issues/40) - asynchronous exec [\#34](https://github.com/shelljs/shelljs/issues/34) **Merged pull requests:** - Passed process arguments to executable script [\#36](https://github.com/shelljs/shelljs/pull/36) ([Zanisimo](https://github.com/Zanisimo)) ## [v0.0.8](https://github.com/shelljs/shelljs/tree/v0.0.8) (2012-10-11) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.7...v0.0.8) **Closed issues:** - exec with callback should automatically be async [\#31](https://github.com/shelljs/shelljs/issues/31) - Exporting variables. [\#30](https://github.com/shelljs/shelljs/issues/30) - Detecting shelljs/node [\#27](https://github.com/shelljs/shelljs/issues/27) **Merged pull requests:** - fix: global leak 'stats' [\#29](https://github.com/shelljs/shelljs/pull/29) ([ando-takahiro](https://github.com/ando-takahiro)) - -a includes . and ..; -A does not [\#28](https://github.com/shelljs/shelljs/pull/28) ([aeosynth](https://github.com/aeosynth)) ## [v0.0.7](https://github.com/shelljs/shelljs/tree/v0.0.7) (2012-09-23) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.6...v0.0.7) **Closed issues:** - gh-pages: clicking 'fork me' just reloads the page [\#26](https://github.com/shelljs/shelljs/issues/26) - Not declared local var implies possible memory leak [\#21](https://github.com/shelljs/shelljs/issues/21) - Cannot echo a string that starts with - [\#20](https://github.com/shelljs/shelljs/issues/20) - Unexpected cp behaviour with directories [\#15](https://github.com/shelljs/shelljs/issues/15) **Merged pull requests:** - add primaries to \_test [\#23](https://github.com/shelljs/shelljs/pull/23) ([aeosynth](https://github.com/aeosynth)) ## [v0.0.6](https://github.com/shelljs/shelljs/tree/v0.0.6) (2012-08-07) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.6pre2...v0.0.6) **Merged pull requests:** - Fixed a global variable leak [\#16](https://github.com/shelljs/shelljs/pull/16) ([dallonf](https://github.com/dallonf)) ## [v0.0.6pre2](https://github.com/shelljs/shelljs/tree/v0.0.6pre2) (2012-05-25) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.6pre1...v0.0.6pre2) ## [v0.0.6pre1](https://github.com/shelljs/shelljs/tree/v0.0.6pre1) (2012-05-25) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.5...v0.0.6pre1) ## [v0.0.5](https://github.com/shelljs/shelljs/tree/v0.0.5) (2012-05-24) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.5pre4...v0.0.5) **Closed issues:** - global.key assigned value 'async' as a result of shell.exec\(...\) [\#12](https://github.com/shelljs/shelljs/issues/12) **Merged pull requests:** - Add support for grep option -v. [\#13](https://github.com/shelljs/shelljs/pull/13) ([kkujala](https://github.com/kkujala)) ## [v0.0.5pre4](https://github.com/shelljs/shelljs/tree/v0.0.5pre4) (2012-03-27) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.5pre3...v0.0.5pre4) ## [v0.0.5pre3](https://github.com/shelljs/shelljs/tree/v0.0.5pre3) (2012-03-27) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.5pre2...v0.0.5pre3) ## [v0.0.5pre2](https://github.com/shelljs/shelljs/tree/v0.0.5pre2) (2012-03-26) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.5pre1...v0.0.5pre2) ## [v0.0.5pre1](https://github.com/shelljs/shelljs/tree/v0.0.5pre1) (2012-03-26) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.4...v0.0.5pre1) **Closed issues:** - rm\(\) does not respect read/write modes [\#6](https://github.com/shelljs/shelljs/issues/6) ## [v0.0.4](https://github.com/shelljs/shelljs/tree/v0.0.4) (2012-03-22) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.3...v0.0.4) **Closed issues:** - "For convenient iteration via `for in`, ..."? [\#4](https://github.com/shelljs/shelljs/issues/4) ## [v0.0.3](https://github.com/shelljs/shelljs/tree/v0.0.3) (2012-03-21) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.2...v0.0.3) ## [v0.0.2](https://github.com/shelljs/shelljs/tree/v0.0.2) (2012-03-15) [Full Changelog](https://github.com/shelljs/shelljs/compare/v0.0.2pre1...v0.0.2) ## [v0.0.2pre1](https://github.com/shelljs/shelljs/tree/v0.0.2pre1) (2012-03-03) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*node-shelljs-0.8.3/CONTRIBUTING.md000066400000000000000000000021141342005425100163340ustar00rootroot00000000000000# Contributing ## Filing a bug report We love to receive bug reports (we're always trying to make ShellJS more stable). If you've found a bug, please follow these steps: - Please try to cut down on duplicates. Please search for issues which have already been reported (remember to search closed issues). - Please see [`ISSUE_TEMPLATE.md`](.github/ISSUE_TEMPLATE.md) for more information. ## Pull requests PRs are welcome! However, we ask that you follow a few guidelines: - Please add tests for all changes/new features. - Make sure your code passes `npm test`. Please check the CI (both Appveyor and Travis). If you can't figure out why something doesn't work, feel free to ask for help. - Make sure you conform to our style guidelines. You can run `npm run lint` to check style, and `npm run lint -- --fix` to automatically fix some issues. - Make documentation changes *within the source files*, not in the README. Update the README with `npm run gendocs`. - Please keep your PR up to date (either via rebase or by pressing the "update branch" button on Github). node-shelljs-0.8.3/LICENSE000066400000000000000000000030601342005425100151110ustar00rootroot00000000000000Copyright (c) 2012, Artur Adib All rights reserved. You may use this project under the terms of the New BSD license as follows: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Artur Adib nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. node-shelljs-0.8.3/README.md000066400000000000000000000534251342005425100153750ustar00rootroot00000000000000# ShellJS - Unix shell commands for Node.js [![Travis](https://img.shields.io/travis/shelljs/shelljs/master.svg?style=flat-square&label=unix)](https://travis-ci.org/shelljs/shelljs) [![AppVeyor](https://img.shields.io/appveyor/ci/shelljs/shelljs/master.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/shelljs/shelljs/branch/master) [![Codecov](https://img.shields.io/codecov/c/github/shelljs/shelljs/master.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shelljs) [![npm version](https://img.shields.io/npm/v/shelljs.svg?style=flat-square)](https://www.npmjs.com/package/shelljs) [![npm downloads](https://img.shields.io/npm/dm/shelljs.svg?style=flat-square)](https://www.npmjs.com/package/shelljs) ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! ShellJS is proudly tested on every node release since `v4`! The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battle-tested in projects like: + [Firebug](http://getfirebug.com/) - Firefox's infamous debugger + [JSHint](http://jshint.com) & [ESLint](http://eslint.org/) - popular JavaScript linters + [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers + [Yeoman](http://yeoman.io/) - Web application stack and development tool + [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation + And [many more](https://npmjs.org/browse/depended/shelljs). If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). Think ShellJS is cool? Check out some related projects in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! Upgrading from an older version? Check out our [breaking changes](https://github.com/shelljs/shelljs/wiki/Breaking-Changes) page to see what changes to watch out for while upgrading. ## Command line use If you just want cross platform UNIX commands, checkout our new project [shelljs/shx](https://github.com/shelljs/shx), a utility to expose `shelljs` to the command line. For example: ``` $ shx mkdir -p foo $ shx touch foo/bar.txt $ shx rm -rf foo ``` ## Plugin API ShellJS now supports third-party plugins! You can learn more about using plugins and writing your own ShellJS commands in [the wiki](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins). ## A quick note about the docs For documentation on all the latest features, check out our [README](https://github.com/shelljs/shelljs). To read docs that are consistent with the latest release, check out [the npm page](https://www.npmjs.com/package/shelljs) or [shelljs.org](http://documentup.com/shelljs/shelljs). ## Installing Via npm: ```bash $ npm install [-g] shelljs ``` ## Examples ```javascript var shell = require('shelljs'); if (!shell.which('git')) { shell.echo('Sorry, this script requires git'); shell.exit(1); } // Copy files to release dir shell.rm('-rf', 'out/Release'); shell.cp('-R', 'stuff/', 'out/Release'); // Replace macros in each .js file shell.cd('lib'); shell.ls('*.js').forEach(function (file) { shell.sed('-i', 'BUILD_VERSION', 'v0.1.2', file); shell.sed('-i', /^.*REMOVE_THIS_LINE.*$/, '', file); shell.sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, shell.cat('macro.js'), file); }); shell.cd('..'); // Run external tool synchronously if (shell.exec('git commit -am "Auto-commit"').code !== 0) { shell.echo('Error: Git commit failed'); shell.exit(1); } ``` ## Exclude options If you need to pass a parameter that looks like an option, you can do so like: ```js shell.grep('--', '-v', 'path/to/file'); // Search for "-v", no grep options shell.cp('-R', '-dir', 'outdir'); // If already using an option, you're done ``` ## Global vs. Local We no longer recommend using a global-import for ShellJS (i.e. `require('shelljs/global')`). While still supported for convenience, this pollutes the global namespace, and should therefore only be used with caution. Instead, we recommend a local import (standard for npm packages): ```javascript var shell = require('shelljs'); shell.echo('hello world'); ``` ## Command reference All commands run synchronously, unless otherwise stated. All commands accept standard bash globbing characters (`*`, `?`, etc.), compatible with the [node `glob` module](https://github.com/isaacs/node-glob). For less-commonly used commands and features, please check out our [wiki page](https://github.com/shelljs/shelljs/wiki). ### cat([options,] file [, file ...]) ### cat([options,] file_array) Available options: + `-n`: number all output lines Examples: ```javascript var str = cat('file*.txt'); var str = cat('file1', 'file2'); var str = cat(['file1', 'file2']); // same as above ``` Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). ### cd([dir]) Changes to directory `dir` for the duration of the script. Changes to home directory if no argument is supplied. ### chmod([options,] octal_mode || octal_string, file) ### chmod([options,] symbolic_mode, file) Available options: + `-v`: output a diagnostic for every file processed + `-c`: like verbose, but report only when a change is made + `-R`: change files and directories recursively Examples: ```javascript chmod(755, '/Users/brandon'); chmod('755', '/Users/brandon'); // same as above chmod('u+x', '/Users/brandon'); chmod('-R', 'a-w', '/Users/brandon'); ``` Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions: + In symbolic modes, `a-r` and `-r` are identical. No consideration is given to the `umask`. + There is no "quiet" option, since default behavior is to run silent. ### cp([options,] source [, source ...], dest) ### cp([options,] source_array, dest) Available options: + `-f`: force (default behavior) + `-n`: no-clobber + `-u`: only copy if `source` is newer than `dest` + `-r`, `-R`: recursive + `-L`: follow symlinks + `-P`: don't follow symlinks Examples: ```javascript cp('file1', 'dir1'); cp('-R', 'path/to/dir/', '~/newCopy/'); cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above ``` Copies files. ### pushd([options,] [dir | '-N' | '+N']) Available options: + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. + `-q`: Supresses output to the console. Arguments: + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. Examples: ```javascript // process.cwd() === '/usr' pushd('/etc'); // Returns /etc /usr pushd('+1'); // Returns /usr /etc ``` Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack. ### popd([options,] ['-N' | '+N']) Available options: + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. + `-q`: Supresses output to the console. Arguments: + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. Examples: ```javascript echo(process.cwd()); // '/usr' pushd('/etc'); // '/etc /usr' echo(process.cwd()); // '/etc' popd(); // '/usr' echo(process.cwd()); // '/usr' ``` When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack. ### dirs([options | '+N' | '-N']) Available options: + `-c`: Clears the directory stack by deleting all of the elements. + `-q`: Supresses output to the console. Arguments: + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified. See also: `pushd`, `popd` ### echo([options,] string [, string ...]) Available options: + `-e`: interpret backslash escapes (default) + `-n`: remove trailing newline from output Examples: ```javascript echo('hello world'); var str = echo('hello world'); echo('-n', 'no newline at end'); ``` Prints `string` to stdout, and returns string with additional utility methods like `.to()`. ### exec(command [, options] [, callback]) Available options: + `async`: Asynchronous execution. If a callback is provided, it will be set to `true`, regardless of the passed value (default: `false`). + `silent`: Do not echo program output to console (default: `false`). + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and what is written to stdout and stderr when not in silent mode (default: `'utf8'`). + and any option available to Node.js's [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) Examples: ```javascript var version = exec('node --version', {silent:true}).stdout; var child = exec('some_long_running_process', {async:true}); child.stdout.on('data', function(data) { /* ... do something with data ... */ }); exec('some_long_running_process', function(code, stdout, stderr) { console.log('Exit code:', code); console.log('Program output:', stdout); console.log('Program stderr:', stderr); }); ``` Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process object, and the `callback` receives the arguments `(code, stdout, stderr)`. Not seeing the behavior you want? `exec()` runs everything through `sh` by default (or `cmd.exe` on Windows), which differs from `bash`. If you need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. ### find(path [, path ...]) ### find(path_array) Examples: ```javascript find('src', 'lib'); find(['src', 'lib']); // same as above find('.').filter(function(file) { return file.match(/\.js$/); }); ``` Returns array of all files (however deep) in the given paths. The main difference from `ls('-R', path)` is that the resulting file names include the base directories (e.g., `lib/resources/file1` instead of just `file1`). ### grep([options,] regex_filter, file [, file ...]) ### grep([options,] regex_filter, file_array) Available options: + `-v`: Invert `regex_filter` (only print non-matching lines). + `-l`: Print only filenames of matching files. + `-i`: Ignore case. Examples: ```javascript grep('-v', 'GLOBAL_VARIABLE', '*.js'); grep('GLOBAL_VARIABLE', '*.js'); ``` Reads input string from given files and returns a string containing all lines of the file that match the given `regex_filter`. ### head([{'-n': \},] file [, file ...]) ### head([{'-n': \},] file_array) Available options: + `-n `: Show the first `` lines of the files Examples: ```javascript var str = head({'-n': 1}, 'file*.txt'); var str = head('file1', 'file2'); var str = head(['file1', 'file2']); // same as above ``` Read the start of a file. ### ln([options,] source, dest) Available options: + `-s`: symlink + `-f`: force Examples: ```javascript ln('file', 'newlink'); ln('-sf', 'file', 'existing'); ``` Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. ### ls([options,] [path, ...]) ### ls([options,] path_array) Available options: + `-R`: recursive + `-A`: all files (include files beginning with `.`, except for `.` and `..`) + `-L`: follow symlinks + `-d`: list directories themselves, not their contents + `-l`: list objects representing each file, each with fields containing `ls -l` output fields. See [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) for more info Examples: ```javascript ls('projs/*.js'); ls('-R', '/users/me', '/tmp'); ls('-R', ['/users/me', '/tmp']); // same as above ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} ``` Returns array of files in the given `path`, or files in the current directory if no `path` is provided. ### mkdir([options,] dir [, dir ...]) ### mkdir([options,] dir_array) Available options: + `-p`: full path (and create intermediate directories, if necessary) Examples: ```javascript mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above ``` Creates directories. ### mv([options ,] source [, source ...], dest') ### mv([options ,] source_array, dest') Available options: + `-f`: force (default behavior) + `-n`: no-clobber Examples: ```javascript mv('-n', 'file', 'dir/'); mv('file1', 'file2', 'dir/'); mv(['file1', 'file2'], 'dir/'); // same as above ``` Moves `source` file(s) to `dest`. ### pwd() Returns the current directory. ### rm([options,] file [, file ...]) ### rm([options,] file_array) Available options: + `-f`: force + `-r, -R`: recursive Examples: ```javascript rm('-rf', '/tmp/*'); rm('some_file.txt', 'another_file.txt'); rm(['some_file.txt', 'another_file.txt']); // same as above ``` Removes files. ### sed([options,] search_regex, replacement, file [, file ...]) ### sed([options,] search_regex, replacement, file_array) Available options: + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ Examples: ```javascript sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); ``` Reads an input string from `file`s, and performs a JavaScript `replace()` on the input using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. Note: Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified using the `$n` syntax: ```javascript sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); ``` ### set(options) Available options: + `+/-e`: exit upon error (`config.fatal`) + `+/-v`: verbose: show all commands (`config.verbose`) + `+/-f`: disable filename expansion (globbing) Examples: ```javascript set('-e'); // exit upon first error set('+e'); // this undoes a "set('-e')" ``` Sets global configuration variables. ### sort([options,] file [, file ...]) ### sort([options,] file_array) Available options: + `-r`: Reverse the results + `-n`: Compare according to numerical value Examples: ```javascript sort('foo.txt', 'bar.txt'); sort('-r', 'foo.txt'); ``` Return the contents of the `file`s, sorted line-by-line. Sorting multiple files mixes their content (just as unix `sort` does). ### tail([{'-n': \},] file [, file ...]) ### tail([{'-n': \},] file_array) Available options: + `-n `: Show the last `` lines of `file`s Examples: ```javascript var str = tail({'-n': 1}, 'file*.txt'); var str = tail('file1', 'file2'); var str = tail(['file1', 'file2']); // same as above ``` Read the end of a `file`. ### tempdir() Examples: ```javascript var tmp = tempdir(); // "/tmp" for most *nix platforms ``` Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). ### test(expression) Available expression primaries: + `'-b', 'path'`: true if path is a block device + `'-c', 'path'`: true if path is a character device + `'-d', 'path'`: true if path is a directory + `'-e', 'path'`: true if path exists + `'-f', 'path'`: true if path is a regular file + `'-L', 'path'`: true if path is a symbolic link + `'-p', 'path'`: true if path is a pipe (FIFO) + `'-S', 'path'`: true if path is a socket Examples: ```javascript if (test('-d', path)) { /* do something with dir */ }; if (!test('-f', path)) continue; // skip if it's a regular file ``` Evaluates `expression` using the available primaries and returns corresponding value. ### ShellString.prototype.to(file) Examples: ```javascript cat('input.txt').to('output.txt'); ``` Analogous to the redirection operator `>` in Unix, but works with `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix redirections, `to()` will overwrite any existing file!_ ### ShellString.prototype.toEnd(file) Examples: ```javascript cat('input.txt').toEnd('output.txt'); ``` Analogous to the redirect-and-append operator `>>` in Unix, but works with `ShellStrings` (such as those returned by `cat`, `grep`, etc.). ### touch([options,] file [, file ...]) ### touch([options,] file_array) Available options: + `-a`: Change only the access time + `-c`: Do not create any files + `-m`: Change only the modification time + `-d DATE`: Parse `DATE` and use it instead of current time + `-r FILE`: Use `FILE`'s times instead of current time Examples: ```javascript touch('source.js'); touch('-c', '/path/to/some/dir/source.js'); touch({ '-r': FILE }, '/path/to/some/dir/source.js'); ``` Update the access and modification times of each `FILE` to the current time. A `FILE` argument that does not exist is created empty, unless `-c` is supplied. This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). ### uniq([options,] [input, [output]]) Available options: + `-i`: Ignore case while comparing + `-c`: Prefix lines by the number of occurrences + `-d`: Only print duplicate lines, one for each group of identical lines Examples: ```javascript uniq('foo.txt'); uniq('-i', 'foo.txt'); uniq('-cd', 'foo.txt', 'bar.txt'); ``` Filter adjacent matching lines from `input`. ### which(command) Examples: ```javascript var nodeExec = which('node'); ``` Searches for `command` in the system's `PATH`. On Windows, this uses the `PATHEXT` variable to append the extension if it's not already executable. Returns string containing the absolute path to `command`. ### exit(code) Exits the current process with the given exit `code`. ### error() Tests if error occurred in the last command. Returns a truthy value if an error returned, or a falsy value otherwise. **Note**: do not rely on the return value to be an error message. If you need the last error message, use the `.stderr` attribute from the last command's return value instead. ### ShellString(str) Examples: ```javascript var foo = ShellString('hello world'); ``` Turns a regular string into a string-like object similar to what each command returns. This has special methods, like `.to()` and `.toEnd()`. ### env['VAR_NAME'] Object containing environment variables (both getter and setter). Shortcut to `process.env`. ### Pipes Examples: ```javascript grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); echo('files with o\'s in the name:\n' + ls().grep('o')); cat('test.js').exec('node'); // pipe to exec() call ``` Commands can send their output to another command in a pipe-like fashion. `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand side of a pipe. Pipes can be chained. ## Configuration ### config.silent Example: ```javascript var sh = require('shelljs'); var silentState = sh.config.silent; // save old silent state sh.config.silent = true; /* ... */ sh.config.silent = silentState; // restore old silent state ``` Suppresses all command output if `true`, except for `echo()` calls. Default is `false`. ### config.fatal Example: ```javascript require('shelljs/global'); config.fatal = true; // or set('-e'); cp('this_file_does_not_exist', '/dev/null'); // throws Error here /* more commands... */ ``` If `true`, the script will throw a Javascript error when any shell.js command encounters an error. Default is `false`. This is analogous to Bash's `set -e`. ### config.verbose Example: ```javascript config.verbose = true; // or set('-v'); cd('dir/'); rm('-rf', 'foo.txt', 'bar.txt'); exec('echo hello'); ``` Will print each command as follows: ``` cd dir/ rm -rf foo.txt bar.txt exec echo hello ``` ### config.globOptions Example: ```javascript config.globOptions = {nodir: true}; ``` Use this value for calls to `glob.sync()` instead of the default options. ### config.reset() Example: ```javascript var shell = require('shelljs'); // Make changes to shell.config, and do stuff... /* ... */ shell.config.reset(); // reset to original state // Do more stuff, but with original settings /* ... */ ``` Reset `shell.config` to the defaults: ```javascript { fatal: false, globOptions: {}, maxdepth: 255, noglob: false, silent: false, verbose: false, } ``` ## Team | [![Nate Fischer](https://avatars.githubusercontent.com/u/5801521?s=130)](https://github.com/nfischer) | [![Brandon Freitag](https://avatars1.githubusercontent.com/u/5988055?v=3&s=130)](http://github.com/freitagbr) | |:---:|:---:| | [Nate Fischer](https://github.com/nfischer) | [Brandon Freitag](http://github.com/freitagbr) | node-shelljs-0.8.3/RELEASE.md000066400000000000000000000010051342005425100155030ustar00rootroot00000000000000# Release steps 1. Ensure master passes CI tests 2. Bump version, create tags, push, and release: - `$ npm run ` - `major` - breaking API changes - `minor` - backwards-compatible features - `patch` - backwards-compatible bug fixes 3. Update `CHANGELOG.md` - `$ npm run changelog` - Manually verify that the changelog makes sense - `$ git push` 4. Generate the documentup website by visiting http://documentup.com/shelljs/shelljs/__recompile in your browser node-shelljs-0.8.3/appveyor.yml000066400000000000000000000010651342005425100164770ustar00rootroot00000000000000environment: matrix: - nodejs_version: '9' - nodejs_version: '8' - nodejs_version: '7' - nodejs_version: '6' - nodejs_version: '5' - nodejs_version: '4' version: '{build}' # Install scripts. (runs after repo cloning) install: - ps: Install-Product node $env:nodejs_version - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm run ci-or-install matrix: fast_finish: false # No need for MSBuild on this project build: off test_script: - npm test on_success: - npm run codecov -- -f coverage/lcov.info node-shelljs-0.8.3/bin/000077500000000000000000000000001342005425100146555ustar00rootroot00000000000000node-shelljs-0.8.3/bin/shjs000077500000000000000000000024101342005425100155470ustar00rootroot00000000000000#!/usr/bin/env node if (require.main !== module) { throw new Error('Executable-only module should not be required'); } // we must import global ShellJS methods after the require.main check to prevent the global // namespace from being polluted if the error is caught require('../global'); function exitWithErrorMessage(msg) { console.log(msg); console.log(); process.exit(1); } if (process.argv.length < 3) { exitWithErrorMessage('ShellJS: missing argument (script name)'); } var args, scriptName = process.argv[2]; env['NODE_PATH'] = __dirname + '/../..'; if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { if (test('-f', scriptName + '.js')) scriptName += '.js'; if (test('-f', scriptName + '.coffee')) scriptName += '.coffee'; } if (!test('-f', scriptName)) { exitWithErrorMessage('ShellJS: script not found ('+scriptName+')'); } args = process.argv.slice(3); for (var i = 0, l = args.length; i < l; i++) { if (args[i][0] !== "-"){ args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words } } var path = require('path'); var extensions = require('interpret').extensions; var rechoir = require('rechoir'); rechoir.prepare(extensions, scriptName); require(require.resolve(path.resolve(process.cwd(), scriptName))); node-shelljs-0.8.3/commands.js000066400000000000000000000004321342005425100162430ustar00rootroot00000000000000module.exports = [ 'cat', 'cd', 'chmod', 'cp', 'dirs', 'echo', 'exec', 'find', 'grep', 'head', 'ln', 'ls', 'mkdir', 'mv', 'pwd', 'rm', 'sed', 'set', 'sort', 'tail', 'tempdir', 'test', 'to', 'toEnd', 'touch', 'uniq', 'which', ]; node-shelljs-0.8.3/global.js000066400000000000000000000005411342005425100157030ustar00rootroot00000000000000/* eslint no-extend-native: 0 */ var shell = require('./shell.js'); var common = require('./src/common'); Object.keys(shell).forEach(function (cmd) { global[cmd] = shell[cmd]; }); var _to = require('./src/to'); String.prototype.to = common.wrap('to', _to); var _toEnd = require('./src/toEnd'); String.prototype.toEnd = common.wrap('toEnd', _toEnd); node-shelljs-0.8.3/make.js000066400000000000000000000024521342005425100153630ustar00rootroot00000000000000require('./global'); global.config.fatal = true; global.target = {}; var args = process.argv.slice(2), targetArgs, dashesLoc = args.indexOf('--'); // split args, everything after -- if only for targets if (dashesLoc > -1) { targetArgs = args.slice(dashesLoc + 1, args.length); args = args.slice(0, dashesLoc); } // This ensures we only execute the script targets after the entire script has // been evaluated setTimeout(function() { var t; if (args.length === 1 && args[0] === '--help') { console.log('Available targets:'); for (t in global.target) console.log(' ' + t); return; } // Wrap targets to prevent duplicate execution for (t in global.target) { (function(t, oldTarget){ // Wrap it global.target[t] = function() { if (!oldTarget.done){ oldTarget.done = true; oldTarget.result = oldTarget.apply(oldTarget, arguments); } return oldTarget.result; }; })(t, global.target[t]); } // Execute desired targets if (args.length > 0) { args.forEach(function(arg) { if (arg in global.target) global.target[arg](targetArgs); else { console.log('no such target: ' + arg); } }); } else if ('all' in global.target) { global.target.all(targetArgs); } }, 0); node-shelljs-0.8.3/package-lock.json000066400000000000000000007515521342005425100173400ustar00rootroot00000000000000{ "name": "shelljs", "version": "0.8.3", "lockfileVersion": 1, "requires": true, "dependencies": { "@ava/babel-plugin-throws-helper": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz", "integrity": "sha1-L8H+PCEacQcaTsp7j3r1hCzRrnw=", "dev": true }, "@ava/babel-preset-stage-4": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.1.0.tgz", "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", "babel-plugin-transform-async-to-generator": "6.24.1", "babel-plugin-transform-es2015-destructuring": "6.23.0", "babel-plugin-transform-es2015-function-name": "6.24.1", "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-plugin-transform-es2015-parameters": "6.24.1", "babel-plugin-transform-es2015-spread": "6.22.0", "babel-plugin-transform-es2015-sticky-regex": "6.24.1", "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "package-hash": "1.2.0" }, "dependencies": { "md5-hex": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { "md5-o-matic": "0.1.1" } }, "package-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz", "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", "dev": true, "requires": { "md5-hex": "1.3.0" } } } }, "@ava/babel-preset-transform-test-files": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz", "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", "dev": true, "requires": { "@ava/babel-plugin-throws-helper": "2.0.0", "babel-plugin-espower": "2.4.0" } }, "@ava/write-file-atomic": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ava/write-file-atomic/-/write-file-atomic-2.2.0.tgz", "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", "slide": "1.1.6" } }, "@concordance/react": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@concordance/react/-/react-1.0.0.tgz", "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", "dev": true, "requires": { "arrify": "1.0.1" } }, "acorn": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-jsx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { "acorn": "3.3.0" }, "dependencies": { "acorn": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } } }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { "co": "4.6.0", "fast-deep-equal": "1.1.0", "fast-json-stable-stringify": "2.0.0", "json-schema-traverse": "0.3.1" } }, "ajv-keywords": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", "dev": true }, "ansi-align": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "dev": true, "requires": { "string-width": "2.1.1" } }, "ansi-escapes": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.2" } }, "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" } }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" } }, "argv": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", "dev": true }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { "arr-flatten": "1.1.0" } }, "arr-exclude": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/arr-exclude/-/arr-exclude-1.0.0.tgz", "integrity": "sha1-38fC5VKicHI8zaBM8xKMjL/lxjE=", "dev": true }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "array-differ": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { "array-uniq": "1.0.3" } }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", "dev": true }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, "auto-bind": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==", "dev": true }, "ava": { "version": "0.21.0", "resolved": "https://registry.npmjs.org/ava/-/ava-0.21.0.tgz", "integrity": "sha512-+ZjahyjqyzkPLlFZe2OoLmiE3aaQ2jK5h74wrkuX5I+J6LpNAPoQ8X/EhqEtKEjuWwmniLAjnVjZ7OY8rWdJwA==", "dev": true, "requires": { "@ava/babel-preset-stage-4": "1.1.0", "@ava/babel-preset-transform-test-files": "3.0.0", "@ava/write-file-atomic": "2.2.0", "@concordance/react": "1.0.0", "ansi-escapes": "2.0.0", "ansi-styles": "3.2.1", "arr-flatten": "1.1.0", "array-union": "1.0.2", "array-uniq": "1.0.3", "arrify": "1.0.1", "auto-bind": "1.2.1", "ava-init": "0.2.1", "babel-core": "6.26.3", "bluebird": "3.5.1", "caching-transform": "1.0.1", "chalk": "2.4.1", "chokidar": "1.7.0", "clean-stack": "1.3.0", "clean-yaml-object": "0.1.0", "cli-cursor": "2.1.0", "cli-spinners": "1.3.1", "cli-truncate": "1.1.0", "co-with-promise": "4.6.0", "code-excerpt": "2.1.1", "common-path-prefix": "1.0.0", "concordance": "3.0.0", "convert-source-map": "1.5.1", "core-assert": "0.2.1", "currently-unhandled": "0.4.1", "debug": "2.6.9", "dot-prop": "4.2.0", "empower-core": "0.6.2", "equal-length": "1.0.1", "figures": "2.0.0", "find-cache-dir": "1.0.0", "fn-name": "2.0.1", "get-port": "3.2.0", "globby": "6.1.0", "has-flag": "2.0.0", "hullabaloo-config-manager": "1.1.1", "ignore-by-default": "1.0.1", "import-local": "0.1.1", "indent-string": "3.2.0", "is-ci": "1.1.0", "is-generator-fn": "1.0.0", "is-obj": "1.0.1", "is-observable": "0.2.0", "is-promise": "2.1.0", "js-yaml": "3.12.0", "last-line-stream": "1.0.0", "lodash.clonedeepwith": "4.5.0", "lodash.debounce": "4.0.8", "lodash.difference": "4.5.0", "lodash.flatten": "4.4.0", "loud-rejection": "1.6.0", "make-dir": "1.3.0", "matcher": "1.1.1", "md5-hex": "2.0.0", "meow": "3.7.0", "ms": "2.1.1", "multimatch": "2.1.0", "observable-to-promise": "0.5.0", "option-chain": "1.0.0", "package-hash": "2.0.0", "pkg-conf": "2.1.0", "plur": "2.1.2", "pretty-ms": "2.1.0", "require-precompiled": "0.1.0", "resolve-cwd": "2.0.0", "safe-buffer": "5.1.2", "slash": "1.0.0", "source-map-support": "0.4.18", "stack-utils": "1.0.1", "strip-ansi": "4.0.0", "strip-bom-buf": "1.0.0", "supports-color": "4.5.0", "time-require": "0.1.2", "trim-off-newlines": "1.0.1", "unique-temp-dir": "1.0.0", "update-notifier": "2.5.0" }, "dependencies": { "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", "supports-color": "5.4.0" }, "dependencies": { "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } } } } } }, "ava-init": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/ava-init/-/ava-init-0.2.1.tgz", "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", "dev": true, "requires": { "arr-exclude": "1.0.0", "execa": "0.7.0", "has-yarn": "1.0.0", "read-pkg-up": "2.0.0", "write-pkg": "3.2.0" } }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", "dev": true }, "aws4": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", "dev": true }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", "js-tokens": "3.0.2" } }, "babel-core": { "version": "6.26.3", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { "babel-code-frame": "6.26.0", "babel-generator": "6.26.1", "babel-helpers": "6.24.1", "babel-messages": "6.23.0", "babel-register": "6.26.0", "babel-runtime": "6.26.0", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", "lodash": "4.17.10", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } }, "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "6.23.0", "babel-runtime": "6.26.0", "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" }, "dependencies": { "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true } } }, "babel-helper-builder-binary-assignment-operator-visitor": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", "dev": true, "requires": { "babel-helper-explode-assignable-expression": "6.24.1", "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-call-delegate": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "dev": true, "requires": { "babel-helper-hoist-variables": "6.24.1", "babel-runtime": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-explode-assignable-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "dev": true, "requires": { "babel-helper-get-function-arity": "6.24.1", "babel-runtime": "6.26.0", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-get-function-arity": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-hoist-variables": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-helper-regex": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", "lodash": "4.17.10" } }, "babel-helper-remap-async-to-generator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", "dev": true, "requires": { "babel-helper-function-name": "6.24.1", "babel-runtime": "6.26.0", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0" } }, "babel-helpers": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-template": "6.26.0" } }, "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { "babel-runtime": "6.26.0" } }, "babel-plugin-check-es2015-constants": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "dev": true, "requires": { "babel-runtime": "6.26.0" } }, "babel-plugin-espower": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-2.4.0.tgz", "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", "dev": true, "requires": { "babel-generator": "6.26.1", "babylon": "6.18.0", "call-matcher": "1.0.1", "core-js": "2.5.7", "espower-location-detector": "1.0.0", "espurify": "1.8.0", "estraverse": "4.2.0" } }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", "dev": true }, "babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", "dev": true }, "babel-plugin-syntax-trailing-function-commas": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", "dev": true }, "babel-plugin-transform-async-to-generator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", "dev": true, "requires": { "babel-helper-remap-async-to-generator": "6.24.1", "babel-plugin-syntax-async-functions": "6.13.0", "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-destructuring": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "dev": true, "requires": { "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", "dev": true, "requires": { "babel-helper-function-name": "6.24.1", "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-modules-commonjs": { "version": "6.26.2", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "dev": true, "requires": { "babel-plugin-transform-strict-mode": "6.24.1", "babel-runtime": "6.26.0", "babel-template": "6.26.0", "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-parameters": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "dev": true, "requires": { "babel-helper-call-delegate": "6.24.1", "babel-helper-get-function-arity": "6.24.1", "babel-runtime": "6.26.0", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-spread": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", "dev": true, "requires": { "babel-runtime": "6.26.0" } }, "babel-plugin-transform-es2015-sticky-regex": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", "dev": true, "requires": { "babel-helper-regex": "6.26.0", "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-plugin-transform-es2015-unicode-regex": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "dev": true, "requires": { "babel-helper-regex": "6.26.0", "babel-runtime": "6.26.0", "regexpu-core": "2.0.0" } }, "babel-plugin-transform-exponentiation-operator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", "dev": true, "requires": { "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", "babel-plugin-syntax-exponentiation-operator": "6.13.0", "babel-runtime": "6.26.0" } }, "babel-plugin-transform-strict-mode": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0" } }, "babel-register": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { "babel-core": "6.26.3", "babel-runtime": "6.26.0", "core-js": "2.5.7", "home-or-tmp": "2.0.0", "lodash": "4.17.10", "mkdirp": "0.5.1", "source-map-support": "0.4.18" } }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { "core-js": "2.5.7", "regenerator-runtime": "0.11.1" } }, "babel-template": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "lodash": "4.17.10" } }, "babel-traverse": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { "babel-code-frame": "6.26.0", "babel-messages": "6.23.0", "babel-runtime": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.4", "lodash": "4.17.10" } }, "babel-types": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "dev": true, "optional": true, "requires": { "tweetnacl": "0.14.5" } }, "binary-extensions": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", "dev": true }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", "dev": true, "requires": { "ansi-align": "2.0.0", "camelcase": "4.1.0", "chalk": "2.4.1", "cli-boxes": "1.0.0", "string-width": "2.1.1", "term-size": "1.2.0", "widest-line": "2.0.0" }, "dependencies": { "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", "supports-color": "5.4.0" } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } } } }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, "braces": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { "expand-range": "1.8.2", "preserve": "0.2.0", "repeat-element": "1.1.2" } }, "buf-compare": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", "dev": true }, "buffer-from": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", "dev": true }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "caching-transform": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", "dev": true, "requires": { "md5-hex": "1.3.0", "mkdirp": "0.5.1", "write-file-atomic": "1.3.4" }, "dependencies": { "md5-hex": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { "md5-o-matic": "0.1.1" } }, "write-file-atomic": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", "slide": "1.1.6" } } } }, "call-matcher": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.0.1.tgz", "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", "dev": true, "requires": { "core-js": "2.5.7", "deep-equal": "1.0.1", "espurify": "1.8.0", "estraverse": "4.2.0" } }, "call-signature": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", "dev": true }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { "callsites": "0.2.0" } }, "callsites": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", "dev": true }, "camelcase-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { "camelcase": "2.1.1", "map-obj": "1.0.1" } }, "capture-stack-trace": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", "dev": true }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.5", "has-ansi": "2.0.0", "strip-ansi": "3.0.1", "supports-color": "2.0.0" }, "dependencies": { "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", "fsevents": "1.2.4", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", "is-glob": "2.0.1", "path-is-absolute": "1.0.1", "readdirp": "2.1.0" } }, "ci-info": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", "dev": true }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "clean-stack": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", "dev": true }, "clean-yaml-object": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", "dev": true }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", "dev": true }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { "restore-cursor": "2.0.0" } }, "cli-spinners": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "dev": true }, "cli-truncate": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", "dev": true, "requires": { "slice-ansi": "1.0.0", "string-width": "2.1.1" } }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "co-with-promise": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co-with-promise/-/co-with-promise-4.6.0.tgz", "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", "dev": true, "requires": { "pinkie-promise": "1.0.0" } }, "code-excerpt": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", "dev": true, "requires": { "convert-to-spaces": "1.0.2" } }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "codecov": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.2.tgz", "integrity": "sha512-9ljtIROIjPIUmMRqO+XuDITDoV8xRrZmA0jcEq6p2hg2+wY9wGmLfreAZGIL72IzUfdEDZaU8+Vjidg1fBQ8GQ==", "dev": true, "requires": { "argv": "0.0.2", "request": "2.87.0", "urlgrey": "0.4.4" } }, "coffee-script": { "version": "1.12.7", "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", "dev": true }, "color-convert": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { "color-name": "1.1.1" } }, "color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "combined-stream": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { "delayed-stream": "1.0.0" } }, "common-path-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", "dev": true }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { "buffer-from": "1.1.0", "inherits": "2.0.3", "readable-stream": "2.3.6", "typedarray": "0.0.6" } }, "concordance": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", "dev": true, "requires": { "date-time": "2.1.0", "esutils": "2.0.2", "fast-diff": "1.1.2", "function-name-support": "0.2.0", "js-string-escape": "1.0.1", "lodash.clonedeep": "4.5.0", "lodash.flattendeep": "4.4.0", "lodash.merge": "4.6.1", "md5-hex": "2.0.0", "semver": "5.5.0", "well-known-symbols": "1.0.0" } }, "configstore": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", "dev": true, "requires": { "dot-prop": "4.2.0", "graceful-fs": "4.1.11", "make-dir": "1.3.0", "unique-string": "1.0.0", "write-file-atomic": "2.3.0", "xdg-basedir": "3.0.0" } }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", "dev": true }, "convert-to-spaces": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", "dev": true }, "core-assert": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", "dev": true, "requires": { "buf-compare": "1.0.1", "is-error": "2.2.1" } }, "core-js": { "version": "2.5.7", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", "dev": true }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "create-error-class": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", "dev": true, "requires": { "capture-stack-trace": "1.0.0" } }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { "lru-cache": "4.1.3", "shebang-command": "1.2.0", "which": "1.3.1" } }, "crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", "dev": true }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { "array-find-index": "1.0.2" } }, "d": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { "es5-ext": "0.10.45" } }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { "assert-plus": "1.0.0" } }, "date-time": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", "dev": true, "requires": { "time-zone": "1.0.0" } }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" }, "dependencies": { "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "dev": true }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", "is-path-in-cwd": "1.0.1", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", "rimraf": "2.6.2" }, "dependencies": { "globby": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { "array-union": "1.0.2", "arrify": "1.0.1", "glob": "7.1.2", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1" } }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } } } }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "dev": true, "requires": { "repeating": "2.0.1" } }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { "esutils": "2.0.2", "isarray": "1.0.0" } }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { "is-obj": "1.0.1" } }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "dev": true, "optional": true, "requires": { "jsbn": "0.1.1" } }, "empower-core": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", "dev": true, "requires": { "call-signature": "0.0.2", "core-js": "2.5.7" } }, "equal-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", "dev": true }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "0.2.1" } }, "es5-ext": { "version": "0.10.45", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.45.tgz", "integrity": "sha512-FkfM6Vxxfmztilbxxz5UKSD4ICMf5tSpRFtDNtkAhOxZ0EKtX6qwmXNyH/sFyIbX2P/nU5AMiA9jilWsUGJzCQ==", "dev": true, "requires": { "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "next-tick": "1.0.0" } }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45", "es6-symbol": "3.1.1" } }, "es6-map": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" } }, "es6-object-assign": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", "dev": true }, "es6-set": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" } }, "es6-symbol": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45" } }, "es6-weak-map": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "escope": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, "requires": { "es6-map": "0.1.5", "es6-weak-map": "2.0.2", "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, "eslint": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz", "integrity": "sha1-5MyPoPAJ+4KaquI4VaKTYL4fbBE=", "dev": true, "requires": { "chalk": "1.1.3", "concat-stream": "1.6.2", "debug": "2.6.9", "doctrine": "1.5.0", "es6-map": "0.1.5", "escope": "3.6.0", "espree": "3.5.4", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "1.3.1", "glob": "7.1.2", "globals": "9.18.0", "ignore": "3.3.10", "imurmurhash": "0.1.4", "inquirer": "0.12.0", "is-my-json-valid": "2.17.2", "is-resolvable": "1.1.0", "js-yaml": "3.12.0", "json-stable-stringify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.10", "mkdirp": "0.5.1", "optionator": "0.8.2", "path-is-absolute": "1.0.1", "path-is-inside": "1.0.2", "pluralize": "1.2.1", "progress": "1.1.8", "require-uncached": "1.0.3", "shelljs": "0.6.1", "strip-json-comments": "1.0.4", "table": "3.8.3", "text-table": "0.2.0", "user-home": "2.0.0" }, "dependencies": { "strip-json-comments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", "dev": true } } }, "eslint-config-airbnb-base": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-3.0.1.tgz", "integrity": "sha1-t3fgH2XpRpM0QrSZ/IUYqiUaZTA=", "dev": true }, "eslint-import-resolver-node": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz", "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", "dev": true, "requires": { "debug": "2.6.9", "object-assign": "4.1.1", "resolve": "1.8.1" } }, "eslint-plugin-import": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-1.16.0.tgz", "integrity": "sha1-svoH68xTUE0PKkR3WC7Iv/GHG58=", "dev": true, "requires": { "builtin-modules": "1.1.1", "contains-path": "0.1.0", "debug": "2.6.9", "doctrine": "1.3.0", "es6-map": "0.1.5", "es6-set": "0.1.5", "eslint-import-resolver-node": "0.2.3", "has": "1.0.3", "lodash.cond": "4.5.2", "lodash.endswith": "4.2.1", "lodash.find": "4.6.0", "lodash.findindex": "4.6.0", "minimatch": "3.0.4", "object-assign": "4.1.1", "pkg-dir": "1.0.0", "pkg-up": "1.0.0" }, "dependencies": { "doctrine": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.3.0.tgz", "integrity": "sha1-E+dWgrVVGEJCdvfBc3g0Vu+RPSY=", "dev": true, "requires": { "esutils": "2.0.2", "isarray": "1.0.0" } }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" } }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "2.0.1" } }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } }, "pkg-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { "find-up": "1.1.2" } } } }, "espower-location-detector": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", "dev": true, "requires": { "is-url": "1.2.4", "path-is-absolute": "1.0.1", "source-map": "0.5.7", "xtend": "4.0.1" } }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { "acorn": "5.7.1", "acorn-jsx": "3.0.1" } }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, "espurify": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.0.tgz", "integrity": "sha512-jdkJG9jswjKCCDmEridNUuIQei9algr+o66ZZ19610ZoBsiWLRsQGNYS4HGez3Z/DsR0lhANGAqiwBUclPuNag==", "dev": true, "requires": { "core-js": "2.5.7" } }, "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { "estraverse": "4.2.0" } }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, "event-emitter": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.45" } }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { "cross-spawn": "5.1.0", "get-stream": "3.0.0", "is-stream": "1.1.0", "npm-run-path": "2.0.2", "p-finally": "1.0.0", "signal-exit": "3.0.2", "strip-eof": "1.0.0" } }, "exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", "dev": true }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { "is-posix-bracket": "0.1.1" } }, "expand-range": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { "fill-range": "2.2.4" } }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true }, "extglob": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { "is-extglob": "1.0.0" } }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, "fast-diff": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { "escape-string-regexp": "1.0.5" } }, "file-entry-cache": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", "integrity": "sha1-RMYepgeuS+nBQC9B9EJwy/4zT/g=", "dev": true, "requires": { "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", "dev": true }, "fill-range": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { "is-number": "2.1.0", "isobject": "2.1.0", "randomatic": "3.0.0", "repeat-element": "1.1.2", "repeat-string": "1.6.1" } }, "find-cache-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", "dev": true, "requires": { "commondir": "1.0.1", "make-dir": "1.3.0", "pkg-dir": "2.0.0" } }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "2.0.0" } }, "flat-cache": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { "circular-json": "0.3.3", "del": "2.2.2", "graceful-fs": "4.1.11", "write": "0.2.1" } }, "fn-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", "dev": true }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, "for-own": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { "for-in": "1.0.2" } }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, "form-data": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "dev": true, "requires": { "asynckit": "0.4.0", "combined-stream": "1.0.6", "mime-types": "2.1.18" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { "nan": "2.11.1", "node-pre-gyp": "0.10.0" }, "dependencies": { "abbrev": { "version": "1.1.1", "bundled": true, "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", "bundled": true, "dev": true }, "aproba": { "version": "1.2.0", "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", "bundled": true, "dev": true, "optional": true, "requires": { "delegates": "1.0.0", "readable-stream": "2.3.6" } }, "balanced-match": { "version": "1.0.0", "bundled": true, "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, "chownr": { "version": "1.0.1", "bundled": true, "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", "bundled": true, "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, "dev": true }, "core-util-is": { "version": "1.0.2", "bundled": true, "dev": true, "optional": true }, "debug": { "version": "2.6.9", "bundled": true, "dev": true, "optional": true, "requires": { "ms": "2.0.0" } }, "deep-extend": { "version": "0.5.1", "bundled": true, "dev": true, "optional": true }, "delegates": { "version": "1.0.0", "bundled": true, "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", "bundled": true, "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", "bundled": true, "dev": true, "optional": true, "requires": { "minipass": "2.2.4" } }, "fs.realpath": { "version": "1.0.0", "bundled": true, "dev": true, "optional": true }, "gauge": { "version": "2.7.4", "bundled": true, "dev": true, "optional": true, "requires": { "aproba": "1.2.0", "console-control-strings": "1.1.0", "has-unicode": "2.0.1", "object-assign": "4.1.1", "signal-exit": "3.0.2", "string-width": "1.0.2", "strip-ansi": "3.0.1", "wide-align": "1.1.2" } }, "glob": { "version": "7.1.2", "bundled": true, "dev": true, "optional": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "has-unicode": { "version": "2.0.1", "bundled": true, "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", "bundled": true, "dev": true, "optional": true, "requires": { "safer-buffer": "2.1.2" } }, "ignore-walk": { "version": "3.0.1", "bundled": true, "dev": true, "optional": true, "requires": { "minimatch": "3.0.4" } }, "inflight": { "version": "1.0.6", "bundled": true, "dev": true, "optional": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" } }, "inherits": { "version": "2.0.3", "bundled": true, "dev": true }, "ini": { "version": "1.3.5", "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "number-is-nan": "1.0.1" } }, "isarray": { "version": "1.0.0", "bundled": true, "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", "bundled": true, "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "minimist": { "version": "0.0.8", "bundled": true, "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, "requires": { "safe-buffer": "5.1.1", "yallist": "3.0.2" } }, "minizlib": { "version": "1.1.0", "bundled": true, "dev": true, "optional": true, "requires": { "minipass": "2.2.4" } }, "mkdirp": { "version": "0.5.1", "bundled": true, "dev": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", "bundled": true, "dev": true, "optional": true }, "needle": { "version": "2.2.0", "bundled": true, "dev": true, "optional": true, "requires": { "debug": "2.6.9", "iconv-lite": "0.4.21", "sax": "1.2.4" } }, "node-pre-gyp": { "version": "0.10.0", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "1.0.3", "mkdirp": "0.5.1", "needle": "2.2.0", "nopt": "4.0.1", "npm-packlist": "1.1.10", "npmlog": "4.1.2", "rc": "1.2.7", "rimraf": "2.6.2", "semver": "5.5.0", "tar": "4.4.1" } }, "nopt": { "version": "4.0.1", "bundled": true, "dev": true, "optional": true, "requires": { "abbrev": "1.1.1", "osenv": "0.1.5" } }, "npm-bundled": { "version": "1.0.3", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", "bundled": true, "dev": true, "optional": true, "requires": { "ignore-walk": "3.0.1", "npm-bundled": "1.0.3" } }, "npmlog": { "version": "4.1.2", "bundled": true, "dev": true, "optional": true, "requires": { "are-we-there-yet": "1.1.4", "console-control-strings": "1.1.0", "gauge": "2.7.4", "set-blocking": "2.0.0" } }, "number-is-nan": { "version": "1.0.1", "bundled": true, "dev": true }, "object-assign": { "version": "4.1.1", "bundled": true, "dev": true, "optional": true }, "once": { "version": "1.4.0", "bundled": true, "dev": true, "requires": { "wrappy": "1.0.2" } }, "os-homedir": { "version": "1.0.2", "bundled": true, "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", "bundled": true, "dev": true, "optional": true }, "osenv": { "version": "0.1.5", "bundled": true, "dev": true, "optional": true, "requires": { "os-homedir": "1.0.2", "os-tmpdir": "1.0.2" } }, "path-is-absolute": { "version": "1.0.1", "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", "bundled": true, "dev": true, "optional": true }, "rc": { "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { "deep-extend": "0.5.1", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { "version": "1.2.0", "bundled": true, "dev": true, "optional": true } } }, "readable-stream": { "version": "2.3.6", "bundled": true, "dev": true, "optional": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", "safe-buffer": "5.1.1", "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, "rimraf": { "version": "2.6.2", "bundled": true, "dev": true, "optional": true, "requires": { "glob": "7.1.2" } }, "safe-buffer": { "version": "5.1.1", "bundled": true, "dev": true }, "safer-buffer": { "version": "2.1.2", "bundled": true, "dev": true, "optional": true }, "sax": { "version": "1.2.4", "bundled": true, "dev": true, "optional": true }, "semver": { "version": "5.5.0", "bundled": true, "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", "bundled": true, "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", "bundled": true, "dev": true, "optional": true }, "string-width": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", "strip-ansi": "3.0.1" } }, "string_decoder": { "version": "1.1.1", "bundled": true, "dev": true, "optional": true, "requires": { "safe-buffer": "5.1.1" } }, "strip-ansi": { "version": "3.0.1", "bundled": true, "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "strip-json-comments": { "version": "2.0.1", "bundled": true, "dev": true, "optional": true }, "tar": { "version": "4.4.1", "bundled": true, "dev": true, "optional": true, "requires": { "chownr": "1.0.1", "fs-minipass": "1.2.5", "minipass": "2.2.4", "minizlib": "1.1.0", "mkdirp": "0.5.1", "safe-buffer": "5.1.1", "yallist": "3.0.2" } }, "util-deprecate": { "version": "1.0.2", "bundled": true, "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", "bundled": true, "dev": true, "optional": true, "requires": { "string-width": "1.0.2" } }, "wrappy": { "version": "1.0.2", "bundled": true, "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, "dev": true } } }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "function-name-support": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", "integrity": "sha1-VdO/qm6v1QWlD5vIH99XVkoLsHE=", "dev": true }, "generate-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", "dev": true }, "generate-object-property": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { "is-property": "1.0.2" } }, "get-port": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", "dev": true }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { "assert-plus": "1.0.0" } }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "glob-base": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { "glob-parent": "2.0.0", "is-glob": "2.0.1" } }, "glob-parent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { "is-glob": "2.0.1" } }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "dev": true, "requires": { "ini": "1.3.5" } }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "globby": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { "array-union": "1.0.2", "glob": "7.1.2", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1" }, "dependencies": { "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } } } }, "got": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { "create-error-class": "3.0.2", "duplexer3": "0.1.4", "get-stream": "3.0.0", "is-redirect": "1.0.0", "is-retry-allowed": "1.1.0", "is-stream": "1.1.0", "lowercase-keys": "1.0.1", "safe-buffer": "5.1.2", "timed-out": "4.0.1", "unzip-response": "2.0.1", "url-parse-lax": "1.0.0" } }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", "dev": true }, "har-validator": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "dev": true, "requires": { "ajv": "5.5.2", "har-schema": "2.0.0" } }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "1.1.1" } }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "has-color": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", "dev": true }, "has-flag": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", "dev": true }, "has-yarn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-1.0.0.tgz", "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", "dev": true }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "dev": true, "requires": { "os-homedir": "1.0.2", "os-tmpdir": "1.0.2" } }, "hosted-git-info": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.1.tgz", "integrity": "sha512-Ba4+0M4YvIDUUsprMjhVTU1yN9F2/LJSAl69ZpzaLT4l4j5mwTS6jqqW9Ojvj6lKz/veqPzpJBqGbXspOb533A==", "dev": true }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { "assert-plus": "1.0.0", "jsprim": "1.4.1", "sshpk": "1.14.2" } }, "hullabaloo-config-manager": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/hullabaloo-config-manager/-/hullabaloo-config-manager-1.1.1.tgz", "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", "dev": true, "requires": { "dot-prop": "4.2.0", "es6-error": "4.1.1", "graceful-fs": "4.1.11", "indent-string": "3.2.0", "json5": "0.5.1", "lodash.clonedeep": "4.5.0", "lodash.clonedeepwith": "4.5.0", "lodash.isequal": "4.5.0", "lodash.merge": "4.6.1", "md5-hex": "2.0.0", "package-hash": "2.0.0", "pkg-dir": "2.0.0", "resolve-from": "3.0.0", "safe-buffer": "5.1.2" } }, "ignore": { "version": "3.3.10", "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", "dev": true }, "import-local": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", "dev": true, "requires": { "pkg-dir": "2.0.0", "resolve-cwd": "2.0.0" } }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { "once": "1.4.0", "wrappy": "1.0.2" } }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "inquirer": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", "dev": true, "requires": { "ansi-escapes": "1.4.0", "ansi-regex": "2.1.1", "chalk": "1.1.3", "cli-cursor": "1.0.2", "cli-width": "2.2.0", "figures": "1.7.0", "lodash": "4.17.10", "readline2": "1.0.1", "run-async": "0.1.0", "rx-lite": "3.1.2", "string-width": "1.0.2", "strip-ansi": "3.0.1", "through": "2.3.8" }, "dependencies": { "ansi-escapes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true }, "cli-cursor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "dev": true, "requires": { "restore-cursor": "1.0.1" } }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { "escape-string-regexp": "1.0.5", "object-assign": "4.1.1" } }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "1.0.1" } }, "onetime": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true }, "restore-cursor": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "dev": true, "requires": { "exit-hook": "1.1.1", "onetime": "1.1.0" } }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", "strip-ansi": "3.0.1" } }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "2.1.1" } } } }, "interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "1.3.1" } }, "irregular-plurals": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", "dev": true }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { "binary-extensions": "1.11.0" } }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "1.1.1" } }, "is-ci": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", "dev": true, "requires": { "ci-info": "1.1.3" } }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", "dev": true }, "is-equal-shallow": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { "is-primitive": "2.0.0" } }, "is-error": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", "dev": true }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", "dev": true }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { "number-is-nan": "1.0.1" } }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-generator-fn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", "dev": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { "is-extglob": "1.0.0" } }, "is-installed-globally": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", "dev": true, "requires": { "global-dirs": "0.1.1", "is-path-inside": "1.0.1" } }, "is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", "dev": true }, "is-my-json-valid": { "version": "2.17.2", "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", "dev": true, "requires": { "generate-function": "2.0.0", "generate-object-property": "1.2.0", "is-my-ip-valid": "1.0.0", "jsonpointer": "4.0.1", "xtend": "4.0.1" } }, "is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", "dev": true }, "is-number": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { "kind-of": "3.2.2" } }, "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, "is-observable": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", "dev": true, "requires": { "symbol-observable": "0.2.4" } }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", "dev": true }, "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "1.0.1" } }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" } }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, "is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", "dev": true }, "is-primitive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, "is-redirect": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-retry-allowed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", "dev": true }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, "is-url": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", "dev": true }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { "isarray": "1.0.0" } }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, "js-string-escape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", "dev": true }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { "argparse": "1.0.10", "esprima": "4.0.0" } }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true, "optional": true }, "jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, "json-schema-traverse": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", "dev": true }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { "jsonify": "0.0.0" } }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, "jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true }, "jsonpointer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", "dev": true }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", "json-schema": "0.2.3", "verror": "1.10.0" } }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { "is-buffer": "1.1.6" } }, "last-line-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/last-line-stream/-/last-line-stream-1.0.0.tgz", "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", "dev": true, "requires": { "through2": "2.0.3" } }, "latest-version": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", "dev": true, "requires": { "package-json": "4.0.1" } }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" } }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", "pify": "2.3.0", "strip-bom": "3.0.0" } }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "2.0.0", "path-exists": "3.0.0" } }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, "lodash.clonedeepwith": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", "integrity": "sha1-buMFc6A6GmDWcKYu8zwQzxr9vdQ=", "dev": true }, "lodash.cond": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", "dev": true }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, "lodash.difference": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", "dev": true }, "lodash.endswith": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.endswith/-/lodash.endswith-4.2.1.tgz", "integrity": "sha1-/tWawXOO0+I27dcGTsRWRIs3vAk=", "dev": true }, "lodash.find": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", "dev": true }, "lodash.findindex": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.findindex/-/lodash.findindex-4.6.0.tgz", "integrity": "sha1-oyRd7mH7m24GJLU1ElYku2nBEQY=", "dev": true }, "lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", "dev": true }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", "dev": true }, "lodash.merge": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", "dev": true }, "loose-envify": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "dev": true, "requires": { "js-tokens": "3.0.2" } }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "dev": true, "requires": { "currently-unhandled": "0.4.1", "signal-exit": "3.0.2" } }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, "lru-cache": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" } }, "make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "3.0.0" }, "dependencies": { "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, "matcher": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", "dev": true, "requires": { "escape-string-regexp": "1.0.5" } }, "math-random": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", "dev": true }, "md5-hex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", "dev": true, "requires": { "md5-o-matic": "0.1.1" } }, "md5-o-matic": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", "dev": true }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { "camelcase-keys": "2.1.0", "decamelize": "1.2.0", "loud-rejection": "1.6.0", "map-obj": "1.0.1", "minimist": "1.2.0", "normalize-package-data": "2.4.0", "object-assign": "4.1.1", "read-pkg-up": "1.0.1", "redent": "1.0.0", "trim-newlines": "1.0.0" }, "dependencies": { "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" } }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", "pify": "2.3.0", "pinkie-promise": "2.0.1", "strip-bom": "2.0.0" } }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "2.0.1" } }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { "graceful-fs": "4.1.11", "pify": "2.3.0", "pinkie-promise": "2.0.1" } }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { "load-json-file": "1.1.0", "normalize-package-data": "2.4.0", "path-type": "1.1.0" } }, "read-pkg-up": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { "find-up": "1.1.2", "read-pkg": "1.1.0" } }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { "is-utf8": "0.2.1" } } } }, "micromatch": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { "arr-diff": "2.0.0", "array-unique": "0.2.1", "braces": "1.8.5", "expand-brackets": "0.1.5", "extglob": "0.3.2", "filename-regex": "2.0.1", "is-extglob": "1.0.0", "is-glob": "2.0.1", "kind-of": "3.2.2", "normalize-path": "2.1.1", "object.omit": "2.0.1", "parse-glob": "3.0.4", "regex-cache": "0.4.4" } }, "mime-db": { "version": "1.33.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "dev": true }, "mime-types": { "version": "2.1.18", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { "mime-db": "1.33.0" } }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "1.1.11" } }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "multimatch": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, "requires": { "array-differ": "1.0.0", "array-union": "1.0.2", "arrify": "1.0.1", "minimatch": "3.0.4" } }, "mute-stream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", "dev": true }, "nan": { "version": "2.11.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", "dev": true, "optional": true }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "2.6.1", "is-builtin-module": "1.0.0", "semver": "5.5.0", "validate-npm-package-license": "3.0.3" } }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { "remove-trailing-separator": "1.1.0" } }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { "path-key": "2.0.1" } }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "nyc": { "version": "11.9.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.9.0.tgz", "integrity": "sha512-w8OdJAhXL5izerzZMdqzYKMj/pgHJyY3qEPYBjLLxrhcVoHEY9pU5ENIiZyCgG9OR7x3VcUMoD40o6PtVpfR4g==", "dev": true, "requires": { "archy": "1.0.0", "arrify": "1.0.1", "caching-transform": "1.0.1", "convert-source-map": "1.5.1", "debug-log": "1.0.1", "default-require-extensions": "1.0.0", "find-cache-dir": "0.1.1", "find-up": "2.1.0", "foreground-child": "1.5.6", "glob": "7.1.2", "istanbul-lib-coverage": "1.2.0", "istanbul-lib-hook": "1.1.0", "istanbul-lib-instrument": "1.10.1", "istanbul-lib-report": "1.1.3", "istanbul-lib-source-maps": "1.2.3", "istanbul-reports": "1.4.0", "md5-hex": "1.3.0", "merge-source-map": "1.1.0", "micromatch": "3.1.10", "mkdirp": "0.5.1", "resolve-from": "2.0.0", "rimraf": "2.6.2", "signal-exit": "3.0.2", "spawn-wrap": "1.4.2", "test-exclude": "4.2.1", "yargs": "11.1.0", "yargs-parser": "8.1.0" }, "dependencies": { "align-text": { "version": "0.1.4", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2", "longest": "1.0.1", "repeat-string": "1.6.1" } }, "amdefine": { "version": "1.0.1", "bundled": true, "dev": true }, "ansi-regex": { "version": "2.1.1", "bundled": true, "dev": true }, "ansi-styles": { "version": "2.2.1", "bundled": true, "dev": true }, "append-transform": { "version": "0.4.0", "bundled": true, "dev": true, "requires": { "default-require-extensions": "1.0.0" } }, "archy": { "version": "1.0.0", "bundled": true, "dev": true }, "arr-diff": { "version": "4.0.0", "bundled": true, "dev": true }, "arr-flatten": { "version": "1.1.0", "bundled": true, "dev": true }, "arr-union": { "version": "3.1.0", "bundled": true, "dev": true }, "array-unique": { "version": "0.3.2", "bundled": true, "dev": true }, "arrify": { "version": "1.0.1", "bundled": true, "dev": true }, "assign-symbols": { "version": "1.0.0", "bundled": true, "dev": true }, "async": { "version": "1.5.2", "bundled": true, "dev": true }, "atob": { "version": "2.1.1", "bundled": true, "dev": true }, "babel-code-frame": { "version": "6.26.0", "bundled": true, "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", "js-tokens": "3.0.2" } }, "babel-generator": { "version": "6.26.1", "bundled": true, "dev": true, "requires": { "babel-messages": "6.23.0", "babel-runtime": "6.26.0", "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" } }, "babel-messages": { "version": "6.23.0", "bundled": true, "dev": true, "requires": { "babel-runtime": "6.26.0" } }, "babel-runtime": { "version": "6.26.0", "bundled": true, "dev": true, "requires": { "core-js": "2.5.6", "regenerator-runtime": "0.11.1" } }, "babel-template": { "version": "6.26.0", "bundled": true, "dev": true, "requires": { "babel-runtime": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "lodash": "4.17.10" } }, "babel-traverse": { "version": "6.26.0", "bundled": true, "dev": true, "requires": { "babel-code-frame": "6.26.0", "babel-messages": "6.23.0", "babel-runtime": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.4", "lodash": "4.17.10" } }, "babel-types": { "version": "6.26.0", "bundled": true, "dev": true, "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, "babylon": { "version": "6.18.0", "bundled": true, "dev": true }, "balanced-match": { "version": "1.0.0", "bundled": true, "dev": true }, "base": { "version": "0.11.2", "bundled": true, "dev": true, "requires": { "cache-base": "1.0.1", "class-utils": "0.3.6", "component-emitter": "1.2.1", "define-property": "1.0.0", "isobject": "3.0.1", "mixin-deep": "1.3.1", "pascalcase": "0.1.1" }, "dependencies": { "define-property": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "is-descriptor": "1.0.2" } }, "is-accessor-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-data-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-descriptor": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "1.0.0", "is-data-descriptor": "1.0.0", "kind-of": "6.0.2" } }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, "braces": { "version": "2.3.2", "bundled": true, "dev": true, "requires": { "arr-flatten": "1.1.0", "array-unique": "0.3.2", "extend-shallow": "2.0.1", "fill-range": "4.0.0", "isobject": "3.0.1", "repeat-element": "1.1.2", "snapdragon": "0.8.2", "snapdragon-node": "2.1.1", "split-string": "3.1.0", "to-regex": "3.0.2" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "builtin-modules": { "version": "1.1.1", "bundled": true, "dev": true }, "cache-base": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "collection-visit": "1.0.0", "component-emitter": "1.2.1", "get-value": "2.0.6", "has-value": "1.0.0", "isobject": "3.0.1", "set-value": "2.0.0", "to-object-path": "0.3.0", "union-value": "1.0.0", "unset-value": "1.0.0" }, "dependencies": { "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "caching-transform": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "md5-hex": "1.3.0", "mkdirp": "0.5.1", "write-file-atomic": "1.3.4" } }, "camelcase": { "version": "1.2.1", "bundled": true, "dev": true, "optional": true }, "center-align": { "version": "0.1.3", "bundled": true, "dev": true, "optional": true, "requires": { "align-text": "0.1.4", "lazy-cache": "1.0.4" } }, "chalk": { "version": "1.1.3", "bundled": true, "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.5", "has-ansi": "2.0.0", "strip-ansi": "3.0.1", "supports-color": "2.0.0" } }, "class-utils": { "version": "0.3.6", "bundled": true, "dev": true, "requires": { "arr-union": "3.1.0", "define-property": "0.2.5", "isobject": "3.0.1", "static-extend": "0.1.2" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "cliui": { "version": "2.1.0", "bundled": true, "dev": true, "optional": true, "requires": { "center-align": "0.1.3", "right-align": "0.1.3", "wordwrap": "0.0.2" }, "dependencies": { "wordwrap": { "version": "0.0.2", "bundled": true, "dev": true, "optional": true } } }, "code-point-at": { "version": "1.1.0", "bundled": true, "dev": true }, "collection-visit": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "map-visit": "1.0.0", "object-visit": "1.0.1" } }, "commondir": { "version": "1.0.1", "bundled": true, "dev": true }, "component-emitter": { "version": "1.2.1", "bundled": true, "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, "dev": true }, "convert-source-map": { "version": "1.5.1", "bundled": true, "dev": true }, "copy-descriptor": { "version": "0.1.1", "bundled": true, "dev": true }, "core-js": { "version": "2.5.6", "bundled": true, "dev": true }, "cross-spawn": { "version": "4.0.2", "bundled": true, "dev": true, "requires": { "lru-cache": "4.1.3", "which": "1.3.0" } }, "debug": { "version": "2.6.9", "bundled": true, "dev": true, "requires": { "ms": "2.0.0" } }, "debug-log": { "version": "1.0.1", "bundled": true, "dev": true }, "decamelize": { "version": "1.2.0", "bundled": true, "dev": true }, "decode-uri-component": { "version": "0.2.0", "bundled": true, "dev": true }, "default-require-extensions": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "strip-bom": "2.0.0" } }, "define-property": { "version": "2.0.2", "bundled": true, "dev": true, "requires": { "is-descriptor": "1.0.2", "isobject": "3.0.1" }, "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-data-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-descriptor": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "1.0.0", "is-data-descriptor": "1.0.0", "kind-of": "6.0.2" } }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "detect-indent": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "repeating": "2.0.1" } }, "error-ex": { "version": "1.3.1", "bundled": true, "dev": true, "requires": { "is-arrayish": "0.2.1" } }, "escape-string-regexp": { "version": "1.0.5", "bundled": true, "dev": true }, "esutils": { "version": "2.0.2", "bundled": true, "dev": true }, "execa": { "version": "0.7.0", "bundled": true, "dev": true, "requires": { "cross-spawn": "5.1.0", "get-stream": "3.0.0", "is-stream": "1.1.0", "npm-run-path": "2.0.2", "p-finally": "1.0.0", "signal-exit": "3.0.2", "strip-eof": "1.0.0" }, "dependencies": { "cross-spawn": { "version": "5.1.0", "bundled": true, "dev": true, "requires": { "lru-cache": "4.1.3", "shebang-command": "1.2.0", "which": "1.3.0" } } } }, "expand-brackets": { "version": "2.1.4", "bundled": true, "dev": true, "requires": { "debug": "2.6.9", "define-property": "0.2.5", "extend-shallow": "2.0.1", "posix-character-classes": "0.1.1", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } }, "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "extend-shallow": { "version": "3.0.2", "bundled": true, "dev": true, "requires": { "assign-symbols": "1.0.0", "is-extendable": "1.0.1" }, "dependencies": { "is-extendable": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "is-plain-object": "2.0.4" } } } }, "extglob": { "version": "2.0.4", "bundled": true, "dev": true, "requires": { "array-unique": "0.3.2", "define-property": "1.0.0", "expand-brackets": "2.1.4", "extend-shallow": "2.0.1", "fragment-cache": "0.2.1", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "define-property": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "is-descriptor": "1.0.2" } }, "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } }, "is-accessor-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-data-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-descriptor": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "1.0.0", "is-data-descriptor": "1.0.0", "kind-of": "6.0.2" } }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "fill-range": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "extend-shallow": "2.0.1", "is-number": "3.0.0", "repeat-string": "1.6.1", "to-regex-range": "2.1.1" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "find-cache-dir": { "version": "0.1.1", "bundled": true, "dev": true, "requires": { "commondir": "1.0.1", "mkdirp": "0.5.1", "pkg-dir": "1.0.0" } }, "find-up": { "version": "2.1.0", "bundled": true, "dev": true, "requires": { "locate-path": "2.0.0" } }, "for-in": { "version": "1.0.2", "bundled": true, "dev": true }, "foreground-child": { "version": "1.5.6", "bundled": true, "dev": true, "requires": { "cross-spawn": "4.0.2", "signal-exit": "3.0.2" } }, "fragment-cache": { "version": "0.2.1", "bundled": true, "dev": true, "requires": { "map-cache": "0.2.2" } }, "fs.realpath": { "version": "1.0.0", "bundled": true, "dev": true }, "get-caller-file": { "version": "1.0.2", "bundled": true, "dev": true }, "get-stream": { "version": "3.0.0", "bundled": true, "dev": true }, "get-value": { "version": "2.0.6", "bundled": true, "dev": true }, "glob": { "version": "7.1.2", "bundled": true, "dev": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", "once": "1.4.0", "path-is-absolute": "1.0.1" } }, "globals": { "version": "9.18.0", "bundled": true, "dev": true }, "graceful-fs": { "version": "4.1.11", "bundled": true, "dev": true }, "handlebars": { "version": "4.0.11", "bundled": true, "dev": true, "requires": { "async": "1.5.2", "optimist": "0.6.1", "source-map": "0.4.4", "uglify-js": "2.8.29" }, "dependencies": { "source-map": { "version": "0.4.4", "bundled": true, "dev": true, "requires": { "amdefine": "1.0.1" } } } }, "has-ansi": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "has-flag": { "version": "1.0.0", "bundled": true, "dev": true }, "has-value": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "get-value": "2.0.6", "has-values": "1.0.0", "isobject": "3.0.1" }, "dependencies": { "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "has-values": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" }, "dependencies": { "is-number": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" }, "dependencies": { "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } } } }, "kind-of": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } } } }, "hosted-git-info": { "version": "2.6.0", "bundled": true, "dev": true }, "imurmurhash": { "version": "0.1.4", "bundled": true, "dev": true }, "inflight": { "version": "1.0.6", "bundled": true, "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" } }, "inherits": { "version": "2.0.3", "bundled": true, "dev": true }, "invariant": { "version": "2.2.4", "bundled": true, "dev": true, "requires": { "loose-envify": "1.3.1" } }, "invert-kv": { "version": "1.0.0", "bundled": true, "dev": true }, "is-accessor-descriptor": { "version": "0.1.6", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } }, "is-arrayish": { "version": "0.2.1", "bundled": true, "dev": true }, "is-buffer": { "version": "1.1.6", "bundled": true, "dev": true }, "is-builtin-module": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "builtin-modules": "1.1.1" } }, "is-data-descriptor": { "version": "0.1.4", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } }, "is-descriptor": { "version": "0.1.6", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", "is-data-descriptor": "0.1.4", "kind-of": "5.1.0" }, "dependencies": { "kind-of": { "version": "5.1.0", "bundled": true, "dev": true } } }, "is-extendable": { "version": "0.1.1", "bundled": true, "dev": true }, "is-finite": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "number-is-nan": "1.0.1" } }, "is-fullwidth-code-point": { "version": "2.0.0", "bundled": true, "dev": true }, "is-number": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } }, "is-odd": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "is-number": "4.0.0" }, "dependencies": { "is-number": { "version": "4.0.0", "bundled": true, "dev": true } } }, "is-plain-object": { "version": "2.0.4", "bundled": true, "dev": true, "requires": { "isobject": "3.0.1" }, "dependencies": { "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "is-stream": { "version": "1.1.0", "bundled": true, "dev": true }, "is-utf8": { "version": "0.2.1", "bundled": true, "dev": true }, "is-windows": { "version": "1.0.2", "bundled": true, "dev": true }, "isarray": { "version": "1.0.0", "bundled": true, "dev": true }, "isexe": { "version": "2.0.0", "bundled": true, "dev": true }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", "bundled": true, "dev": true }, "istanbul-lib-hook": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "append-transform": "0.4.0" } }, "istanbul-lib-instrument": { "version": "1.10.1", "bundled": true, "dev": true, "requires": { "babel-generator": "6.26.1", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "istanbul-lib-coverage": "1.2.0", "semver": "5.5.0" } }, "istanbul-lib-report": { "version": "1.1.3", "bundled": true, "dev": true, "requires": { "istanbul-lib-coverage": "1.2.0", "mkdirp": "0.5.1", "path-parse": "1.0.5", "supports-color": "3.2.3" }, "dependencies": { "supports-color": { "version": "3.2.3", "bundled": true, "dev": true, "requires": { "has-flag": "1.0.0" } } } }, "istanbul-lib-source-maps": { "version": "1.2.3", "bundled": true, "dev": true, "requires": { "debug": "3.1.0", "istanbul-lib-coverage": "1.2.0", "mkdirp": "0.5.1", "rimraf": "2.6.2", "source-map": "0.5.7" }, "dependencies": { "debug": { "version": "3.1.0", "bundled": true, "dev": true, "requires": { "ms": "2.0.0" } } } }, "istanbul-reports": { "version": "1.4.0", "bundled": true, "dev": true, "requires": { "handlebars": "4.0.11" } }, "js-tokens": { "version": "3.0.2", "bundled": true, "dev": true }, "jsesc": { "version": "1.3.0", "bundled": true, "dev": true }, "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } }, "lazy-cache": { "version": "1.0.4", "bundled": true, "dev": true, "optional": true }, "lcid": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "invert-kv": "1.0.0" } }, "load-json-file": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "2.2.0", "pify": "2.3.0", "pinkie-promise": "2.0.1", "strip-bom": "2.0.0" } }, "locate-path": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "p-locate": "2.0.0", "path-exists": "3.0.0" }, "dependencies": { "path-exists": { "version": "3.0.0", "bundled": true, "dev": true } } }, "lodash": { "version": "4.17.10", "bundled": true, "dev": true }, "longest": { "version": "1.0.1", "bundled": true, "dev": true }, "loose-envify": { "version": "1.3.1", "bundled": true, "dev": true, "requires": { "js-tokens": "3.0.2" } }, "lru-cache": { "version": "4.1.3", "bundled": true, "dev": true, "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" } }, "map-cache": { "version": "0.2.2", "bundled": true, "dev": true }, "map-visit": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "object-visit": "1.0.1" } }, "md5-hex": { "version": "1.3.0", "bundled": true, "dev": true, "requires": { "md5-o-matic": "0.1.1" } }, "md5-o-matic": { "version": "0.1.1", "bundled": true, "dev": true }, "mem": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "mimic-fn": "1.2.0" } }, "merge-source-map": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "source-map": "0.6.1" }, "dependencies": { "source-map": { "version": "0.6.1", "bundled": true, "dev": true } } }, "micromatch": { "version": "3.1.10", "bundled": true, "dev": true, "requires": { "arr-diff": "4.0.0", "array-unique": "0.3.2", "braces": "2.3.2", "define-property": "2.0.2", "extend-shallow": "3.0.2", "extglob": "2.0.4", "fragment-cache": "0.2.1", "kind-of": "6.0.2", "nanomatch": "1.2.9", "object.pick": "1.3.0", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "mimic-fn": { "version": "1.2.0", "bundled": true, "dev": true }, "minimatch": { "version": "3.0.4", "bundled": true, "dev": true, "requires": { "brace-expansion": "1.1.11" } }, "minimist": { "version": "0.0.8", "bundled": true, "dev": true }, "mixin-deep": { "version": "1.3.1", "bundled": true, "dev": true, "requires": { "for-in": "1.0.2", "is-extendable": "1.0.1" }, "dependencies": { "is-extendable": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "is-plain-object": "2.0.4" } } } }, "mkdirp": { "version": "0.5.1", "bundled": true, "dev": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", "bundled": true, "dev": true }, "nanomatch": { "version": "1.2.9", "bundled": true, "dev": true, "requires": { "arr-diff": "4.0.0", "array-unique": "0.3.2", "define-property": "2.0.2", "extend-shallow": "3.0.2", "fragment-cache": "0.2.1", "is-odd": "2.0.0", "is-windows": "1.0.2", "kind-of": "6.0.2", "object.pick": "1.3.0", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "arr-diff": { "version": "4.0.0", "bundled": true, "dev": true }, "array-unique": { "version": "0.3.2", "bundled": true, "dev": true }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "normalize-package-data": { "version": "2.4.0", "bundled": true, "dev": true, "requires": { "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", "semver": "5.5.0", "validate-npm-package-license": "3.0.3" } }, "npm-run-path": { "version": "2.0.2", "bundled": true, "dev": true, "requires": { "path-key": "2.0.1" } }, "number-is-nan": { "version": "1.0.1", "bundled": true, "dev": true }, "object-assign": { "version": "4.1.1", "bundled": true, "dev": true }, "object-copy": { "version": "0.1.0", "bundled": true, "dev": true, "requires": { "copy-descriptor": "0.1.1", "define-property": "0.2.5", "kind-of": "3.2.2" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } } } }, "object-visit": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "isobject": "3.0.1" }, "dependencies": { "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "object.pick": { "version": "1.3.0", "bundled": true, "dev": true, "requires": { "isobject": "3.0.1" }, "dependencies": { "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "once": { "version": "1.4.0", "bundled": true, "dev": true, "requires": { "wrappy": "1.0.2" } }, "optimist": { "version": "0.6.1", "bundled": true, "dev": true, "requires": { "minimist": "0.0.8", "wordwrap": "0.0.3" } }, "os-homedir": { "version": "1.0.2", "bundled": true, "dev": true }, "os-locale": { "version": "2.1.0", "bundled": true, "dev": true, "requires": { "execa": "0.7.0", "lcid": "1.0.0", "mem": "1.1.0" } }, "p-finally": { "version": "1.0.0", "bundled": true, "dev": true }, "p-limit": { "version": "1.2.0", "bundled": true, "dev": true, "requires": { "p-try": "1.0.0" } }, "p-locate": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "p-limit": "1.2.0" } }, "p-try": { "version": "1.0.0", "bundled": true, "dev": true }, "parse-json": { "version": "2.2.0", "bundled": true, "dev": true, "requires": { "error-ex": "1.3.1" } }, "pascalcase": { "version": "0.1.1", "bundled": true, "dev": true }, "path-exists": { "version": "2.1.0", "bundled": true, "dev": true, "requires": { "pinkie-promise": "2.0.1" } }, "path-is-absolute": { "version": "1.0.1", "bundled": true, "dev": true }, "path-key": { "version": "2.0.1", "bundled": true, "dev": true }, "path-parse": { "version": "1.0.5", "bundled": true, "dev": true }, "path-type": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "graceful-fs": "4.1.11", "pify": "2.3.0", "pinkie-promise": "2.0.1" } }, "pify": { "version": "2.3.0", "bundled": true, "dev": true }, "pinkie": { "version": "2.0.4", "bundled": true, "dev": true }, "pinkie-promise": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "pinkie": "2.0.4" } }, "pkg-dir": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "find-up": "1.1.2" }, "dependencies": { "find-up": { "version": "1.1.2", "bundled": true, "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" } } } }, "posix-character-classes": { "version": "0.1.1", "bundled": true, "dev": true }, "pseudomap": { "version": "1.0.2", "bundled": true, "dev": true }, "read-pkg": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "load-json-file": "1.1.0", "normalize-package-data": "2.4.0", "path-type": "1.1.0" } }, "read-pkg-up": { "version": "1.0.1", "bundled": true, "dev": true, "requires": { "find-up": "1.1.2", "read-pkg": "1.1.0" }, "dependencies": { "find-up": { "version": "1.1.2", "bundled": true, "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" } } } }, "regenerator-runtime": { "version": "0.11.1", "bundled": true, "dev": true }, "regex-not": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "extend-shallow": "3.0.2", "safe-regex": "1.1.0" } }, "repeat-element": { "version": "1.1.2", "bundled": true, "dev": true }, "repeat-string": { "version": "1.6.1", "bundled": true, "dev": true }, "repeating": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-finite": "1.0.2" } }, "require-directory": { "version": "2.1.1", "bundled": true, "dev": true }, "require-main-filename": { "version": "1.0.1", "bundled": true, "dev": true }, "resolve-from": { "version": "2.0.0", "bundled": true, "dev": true }, "resolve-url": { "version": "0.2.1", "bundled": true, "dev": true }, "ret": { "version": "0.1.15", "bundled": true, "dev": true }, "right-align": { "version": "0.1.3", "bundled": true, "dev": true, "optional": true, "requires": { "align-text": "0.1.4" } }, "rimraf": { "version": "2.6.2", "bundled": true, "dev": true, "requires": { "glob": "7.1.2" } }, "safe-regex": { "version": "1.1.0", "bundled": true, "dev": true, "requires": { "ret": "0.1.15" } }, "semver": { "version": "5.5.0", "bundled": true, "dev": true }, "set-blocking": { "version": "2.0.0", "bundled": true, "dev": true }, "set-value": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "extend-shallow": "2.0.1", "is-extendable": "0.1.1", "is-plain-object": "2.0.4", "split-string": "3.1.0" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "shebang-command": { "version": "1.2.0", "bundled": true, "dev": true, "requires": { "shebang-regex": "1.0.0" } }, "shebang-regex": { "version": "1.0.0", "bundled": true, "dev": true }, "signal-exit": { "version": "3.0.2", "bundled": true, "dev": true }, "slide": { "version": "1.1.6", "bundled": true, "dev": true }, "snapdragon": { "version": "0.8.2", "bundled": true, "dev": true, "requires": { "base": "0.11.2", "debug": "2.6.9", "define-property": "0.2.5", "extend-shallow": "2.0.1", "map-cache": "0.2.2", "source-map": "0.5.7", "source-map-resolve": "0.5.1", "use": "3.1.0" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } }, "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "snapdragon-node": { "version": "2.1.1", "bundled": true, "dev": true, "requires": { "define-property": "1.0.0", "isobject": "3.0.1", "snapdragon-util": "3.0.1" }, "dependencies": { "define-property": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "is-descriptor": "1.0.2" } }, "is-accessor-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-data-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-descriptor": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "1.0.0", "is-data-descriptor": "1.0.0", "kind-of": "6.0.2" } }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "snapdragon-util": { "version": "3.0.1", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } }, "source-map": { "version": "0.5.7", "bundled": true, "dev": true }, "source-map-resolve": { "version": "0.5.1", "bundled": true, "dev": true, "requires": { "atob": "2.1.1", "decode-uri-component": "0.2.0", "resolve-url": "0.2.1", "source-map-url": "0.4.0", "urix": "0.1.0" } }, "source-map-url": { "version": "0.4.0", "bundled": true, "dev": true }, "spawn-wrap": { "version": "1.4.2", "bundled": true, "dev": true, "requires": { "foreground-child": "1.5.6", "mkdirp": "0.5.1", "os-homedir": "1.0.2", "rimraf": "2.6.2", "signal-exit": "3.0.2", "which": "1.3.0" } }, "spdx-correct": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "spdx-expression-parse": "3.0.0", "spdx-license-ids": "3.0.0" } }, "spdx-exceptions": { "version": "2.1.0", "bundled": true, "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "spdx-exceptions": "2.1.0", "spdx-license-ids": "3.0.0" } }, "spdx-license-ids": { "version": "3.0.0", "bundled": true, "dev": true }, "split-string": { "version": "3.1.0", "bundled": true, "dev": true, "requires": { "extend-shallow": "3.0.2" } }, "static-extend": { "version": "0.1.2", "bundled": true, "dev": true, "requires": { "define-property": "0.2.5", "object-copy": "0.1.0" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } } } }, "string-width": { "version": "2.1.1", "bundled": true, "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" }, "dependencies": { "ansi-regex": { "version": "3.0.0", "bundled": true, "dev": true }, "strip-ansi": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "ansi-regex": "3.0.0" } } } }, "strip-ansi": { "version": "3.0.1", "bundled": true, "dev": true, "requires": { "ansi-regex": "2.1.1" } }, "strip-bom": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { "is-utf8": "0.2.1" } }, "strip-eof": { "version": "1.0.0", "bundled": true, "dev": true }, "supports-color": { "version": "2.0.0", "bundled": true, "dev": true }, "test-exclude": { "version": "4.2.1", "bundled": true, "dev": true, "requires": { "arrify": "1.0.1", "micromatch": "3.1.10", "object-assign": "4.1.1", "read-pkg-up": "1.0.1", "require-main-filename": "1.0.1" }, "dependencies": { "arr-diff": { "version": "4.0.0", "bundled": true, "dev": true }, "array-unique": { "version": "0.3.2", "bundled": true, "dev": true }, "braces": { "version": "2.3.2", "bundled": true, "dev": true, "requires": { "arr-flatten": "1.1.0", "array-unique": "0.3.2", "extend-shallow": "2.0.1", "fill-range": "4.0.0", "isobject": "3.0.1", "repeat-element": "1.1.2", "snapdragon": "0.8.2", "snapdragon-node": "2.1.1", "split-string": "3.1.0", "to-regex": "3.0.2" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "expand-brackets": { "version": "2.1.4", "bundled": true, "dev": true, "requires": { "debug": "2.6.9", "define-property": "0.2.5", "extend-shallow": "2.0.1", "posix-character-classes": "0.1.1", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { "is-descriptor": "0.1.6" } }, "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } }, "is-accessor-descriptor": { "version": "0.1.6", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" }, "dependencies": { "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } } } }, "is-data-descriptor": { "version": "0.1.4", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" }, "dependencies": { "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } } } }, "is-descriptor": { "version": "0.1.6", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", "is-data-descriptor": "0.1.4", "kind-of": "5.1.0" } }, "kind-of": { "version": "5.1.0", "bundled": true, "dev": true } } }, "extglob": { "version": "2.0.4", "bundled": true, "dev": true, "requires": { "array-unique": "0.3.2", "define-property": "1.0.0", "expand-brackets": "2.1.4", "extend-shallow": "2.0.1", "fragment-cache": "0.2.1", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" }, "dependencies": { "define-property": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "is-descriptor": "1.0.2" } }, "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "fill-range": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "extend-shallow": "2.0.1", "is-number": "3.0.0", "repeat-string": "1.6.1", "to-regex-range": "2.1.1" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } } } }, "is-accessor-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-data-descriptor": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" } }, "is-descriptor": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "1.0.0", "is-data-descriptor": "1.0.0", "kind-of": "6.0.2" } }, "is-number": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" }, "dependencies": { "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { "is-buffer": "1.1.6" } } } }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true }, "kind-of": { "version": "6.0.2", "bundled": true, "dev": true }, "micromatch": { "version": "3.1.10", "bundled": true, "dev": true, "requires": { "arr-diff": "4.0.0", "array-unique": "0.3.2", "braces": "2.3.2", "define-property": "2.0.2", "extend-shallow": "3.0.2", "extglob": "2.0.4", "fragment-cache": "0.2.1", "kind-of": "6.0.2", "nanomatch": "1.2.9", "object.pick": "1.3.0", "regex-not": "1.0.2", "snapdragon": "0.8.2", "to-regex": "3.0.2" } } } }, "to-fast-properties": { "version": "1.0.3", "bundled": true, "dev": true }, "to-object-path": { "version": "0.3.0", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } }, "to-regex": { "version": "3.0.2", "bundled": true, "dev": true, "requires": { "define-property": "2.0.2", "extend-shallow": "3.0.2", "regex-not": "1.0.2", "safe-regex": "1.1.0" } }, "to-regex-range": { "version": "2.1.1", "bundled": true, "dev": true, "requires": { "is-number": "3.0.0", "repeat-string": "1.6.1" }, "dependencies": { "is-number": { "version": "3.0.0", "bundled": true, "dev": true, "requires": { "kind-of": "3.2.2" } } } }, "trim-right": { "version": "1.0.1", "bundled": true, "dev": true }, "uglify-js": { "version": "2.8.29", "bundled": true, "dev": true, "optional": true, "requires": { "source-map": "0.5.7", "uglify-to-browserify": "1.0.2", "yargs": "3.10.0" }, "dependencies": { "yargs": { "version": "3.10.0", "bundled": true, "dev": true, "optional": true, "requires": { "camelcase": "1.2.1", "cliui": "2.1.0", "decamelize": "1.2.0", "window-size": "0.1.0" } } } }, "uglify-to-browserify": { "version": "1.0.2", "bundled": true, "dev": true, "optional": true }, "union-value": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "arr-union": "3.1.0", "get-value": "2.0.6", "is-extendable": "0.1.1", "set-value": "0.4.3" }, "dependencies": { "extend-shallow": { "version": "2.0.1", "bundled": true, "dev": true, "requires": { "is-extendable": "0.1.1" } }, "set-value": { "version": "0.4.3", "bundled": true, "dev": true, "requires": { "extend-shallow": "2.0.1", "is-extendable": "0.1.1", "is-plain-object": "2.0.4", "to-object-path": "0.3.0" } } } }, "unset-value": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "has-value": "0.3.1", "isobject": "3.0.1" }, "dependencies": { "has-value": { "version": "0.3.1", "bundled": true, "dev": true, "requires": { "get-value": "2.0.6", "has-values": "0.1.4", "isobject": "2.1.0" }, "dependencies": { "isobject": { "version": "2.1.0", "bundled": true, "dev": true, "requires": { "isarray": "1.0.0" } } } }, "has-values": { "version": "0.1.4", "bundled": true, "dev": true }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true } } }, "urix": { "version": "0.1.0", "bundled": true, "dev": true }, "use": { "version": "3.1.0", "bundled": true, "dev": true, "requires": { "kind-of": "6.0.2" }, "dependencies": { "kind-of": { "version": "6.0.2", "bundled": true, "dev": true } } }, "validate-npm-package-license": { "version": "3.0.3", "bundled": true, "dev": true, "requires": { "spdx-correct": "3.0.0", "spdx-expression-parse": "3.0.0" } }, "which": { "version": "1.3.0", "bundled": true, "dev": true, "requires": { "isexe": "2.0.0" } }, "which-module": { "version": "2.0.0", "bundled": true, "dev": true }, "window-size": { "version": "0.1.0", "bundled": true, "dev": true, "optional": true }, "wordwrap": { "version": "0.0.3", "bundled": true, "dev": true }, "wrap-ansi": { "version": "2.1.0", "bundled": true, "dev": true, "requires": { "string-width": "1.0.2", "strip-ansi": "3.0.1" }, "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { "number-is-nan": "1.0.1" } }, "string-width": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", "strip-ansi": "3.0.1" } } } }, "wrappy": { "version": "1.0.2", "bundled": true, "dev": true }, "write-file-atomic": { "version": "1.3.4", "bundled": true, "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", "slide": "1.1.6" } }, "y18n": { "version": "3.2.1", "bundled": true, "dev": true }, "yallist": { "version": "2.1.2", "bundled": true, "dev": true }, "yargs": { "version": "11.1.0", "bundled": true, "dev": true, "requires": { "cliui": "4.1.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", "os-locale": "2.1.0", "require-directory": "2.1.1", "require-main-filename": "1.0.1", "set-blocking": "2.0.0", "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", "yargs-parser": "9.0.2" }, "dependencies": { "ansi-regex": { "version": "3.0.0", "bundled": true, "dev": true }, "camelcase": { "version": "4.1.0", "bundled": true, "dev": true }, "cliui": { "version": "4.1.0", "bundled": true, "dev": true, "requires": { "string-width": "2.1.1", "strip-ansi": "4.0.0", "wrap-ansi": "2.1.0" } }, "strip-ansi": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { "ansi-regex": "3.0.0" } }, "yargs-parser": { "version": "9.0.2", "bundled": true, "dev": true, "requires": { "camelcase": "4.1.0" } } } }, "yargs-parser": { "version": "8.1.0", "bundled": true, "dev": true, "requires": { "camelcase": "4.1.0" }, "dependencies": { "camelcase": { "version": "4.1.0", "bundled": true, "dev": true } } } } }, "oauth-sign": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", "dev": true }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { "for-own": "0.1.5", "is-extendable": "0.1.1" } }, "observable-to-promise": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-0.5.0.tgz", "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", "dev": true, "requires": { "is-observable": "0.2.0", "symbol-observable": "1.2.0" }, "dependencies": { "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", "dev": true } } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1.0.2" } }, "onetime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { "mimic-fn": "1.2.0" } }, "option-chain": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/option-chain/-/option-chain-1.0.0.tgz", "integrity": "sha1-k41zvU4Xg/lI00AjZEraI2aeMPI=", "dev": true }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", "levn": "0.3.0", "prelude-ls": "1.1.2", "type-check": "0.3.2", "wordwrap": "1.0.0" } }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "1.0.0" } }, "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "1.3.0" } }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "package-hash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz", "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", "dev": true, "requires": { "graceful-fs": "4.1.11", "lodash.flattendeep": "4.4.0", "md5-hex": "2.0.0", "release-zalgo": "1.0.0" } }, "package-json": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "dev": true, "requires": { "got": "6.7.1", "registry-auth-token": "3.3.2", "registry-url": "3.1.0", "semver": "5.5.0" } }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { "glob-base": "0.3.0", "is-dotfile": "1.0.3", "is-extglob": "1.0.0", "is-glob": "2.0.1" } }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { "error-ex": "1.3.2" } }, "parse-ms": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", "dev": true }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { "pify": "2.3.0" } }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", "dev": true }, "pinkie-promise": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", "dev": true, "requires": { "pinkie": "1.0.0" } }, "pkg-conf": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { "find-up": "2.1.0", "load-json-file": "4.0.0" }, "dependencies": { "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "4.1.11", "parse-json": "4.0.0", "pify": "3.0.0", "strip-bom": "3.0.0" } }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "1.3.2", "json-parse-better-errors": "1.0.2" } }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { "find-up": "2.1.0" } }, "pkg-up": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", "integrity": "sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY=", "dev": true, "requires": { "find-up": "1.1.2" }, "dependencies": { "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "2.1.0", "pinkie-promise": "2.0.1" } }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "2.0.1" } }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "2.0.4" } } } }, "plur": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", "dev": true, "requires": { "irregular-plurals": "1.4.0" } }, "pluralize": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", "dev": true }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, "pretty-ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", "dev": true, "requires": { "is-finite": "1.0.2", "parse-ms": "1.0.1", "plur": "1.0.0" }, "dependencies": { "plur": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", "dev": true } } }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "randomatic": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "dev": true, "requires": { "is-number": "4.0.0", "kind-of": "6.0.2", "math-random": "1.0.1" }, "dependencies": { "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", "dev": true }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { "deep-extend": "0.6.0", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { "load-json-file": "2.0.0", "normalize-package-data": "2.4.0", "path-type": "2.0.0" } }, "read-pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { "find-up": "2.1.0", "read-pkg": "2.0.0" } }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", "safe-buffer": "5.1.2", "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, "readdirp": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "dev": true, "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", "readable-stream": "2.3.6", "set-immediate-shim": "1.0.1" } }, "readline2": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", "dev": true, "requires": { "code-point-at": "1.1.0", "is-fullwidth-code-point": "1.0.0", "mute-stream": "0.0.5" }, "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "1.0.1" } } } }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { "resolve": "1.8.1" } }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "dev": true, "requires": { "indent-string": "2.1.0", "strip-indent": "1.0.1" }, "dependencies": { "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "dev": true, "requires": { "repeating": "2.0.1" } } } }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { "is-equal-shallow": "0.1.3" } }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } }, "registry-auth-token": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", "dev": true, "requires": { "rc": "1.2.8", "safe-buffer": "5.1.2" } }, "registry-url": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { "rc": "1.2.8" } }, "regjsgen": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, "regjsparser": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { "jsesc": "0.5.0" } }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { "es6-error": "4.1.1" } }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", "dev": true }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { "is-finite": "1.0.2" } }, "request": { "version": "2.87.0", "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "dev": true, "requires": { "aws-sign2": "0.7.0", "aws4": "1.7.0", "caseless": "0.12.0", "combined-stream": "1.0.6", "extend": "3.0.1", "forever-agent": "0.6.1", "form-data": "2.3.2", "har-validator": "5.0.3", "http-signature": "1.2.0", "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", "mime-types": "2.1.18", "oauth-sign": "0.8.2", "performance-now": "2.1.0", "qs": "6.5.2", "safe-buffer": "5.1.2", "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", "uuid": "3.3.0" } }, "require-precompiled": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", "dev": true }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { "caller-path": "0.1.0", "resolve-from": "1.0.1" }, "dependencies": { "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true } } }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "requires": { "path-parse": "1.0.5" } }, "resolve-cwd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { "resolve-from": "3.0.0" } }, "resolve-from": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { "onetime": "2.0.1", "signal-exit": "3.0.2" } }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "7.1.2" } }, "run-async": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", "dev": true, "requires": { "once": "1.4.0" } }, "rx-lite": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", "dev": true }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "semver-diff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { "semver": "5.5.0" } }, "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "1.0.0" } }, "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "shelljs": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", "integrity": "sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=", "dev": true }, "shelljs-changelog": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/shelljs-changelog/-/shelljs-changelog-0.2.5.tgz", "integrity": "sha1-qDkhj9cqyfz4QGW8lNzTCzDS/x8=", "dev": true, "requires": { "shelljs": "0.7.8" }, "dependencies": { "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { "glob": "7.1.2", "interpret": "1.1.0", "rechoir": "0.6.2" } } } }, "shelljs-release": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/shelljs-release/-/shelljs-release-0.3.0.tgz", "integrity": "sha512-mTFv773NZF83TyOhmbOT+u7dlh5uqCawvGBuaM6ArHhDo4Y+XNPkZ5m1U9eUfoAJg6Cfiag21JbLO+d13guDXw==", "dev": true, "requires": { "minimist": "1.2.0", "shelljs": "0.7.8" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { "glob": "7.1.2", "interpret": "1.1.0", "rechoir": "0.6.2" } } } }, "shx": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/shx/-/shx-0.2.2.tgz", "integrity": "sha1-CjBNAgsO3xMGrYFXDoDwNG31ijk=", "dev": true, "requires": { "es6-object-assign": "1.1.0", "minimist": "1.2.0", "shelljs": "0.7.8" }, "dependencies": { "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { "glob": "7.1.2", "interpret": "1.1.0", "rechoir": "0.6.2" } } } }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0" } }, "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", "dev": true }, "sort-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "dev": true, "requires": { "is-plain-obj": "1.1.0" } }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { "source-map": "0.5.7" } }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { "spdx-expression-parse": "3.0.0", "spdx-license-ids": "3.0.0" } }, "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { "spdx-exceptions": "2.1.0", "spdx-license-ids": "3.0.0" } }, "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "sshpk": { "version": "1.14.2", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "dev": true, "requires": { "asn1": "0.2.3", "assert-plus": "1.0.0", "bcrypt-pbkdf": "1.0.1", "dashdash": "1.14.1", "ecc-jsbn": "0.1.1", "getpass": "0.1.7", "jsbn": "0.1.1", "safer-buffer": "2.1.2", "tweetnacl": "0.14.5" } }, "stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", "dev": true }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" } }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "5.1.2" } }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "3.0.0" }, "dependencies": { "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true } } }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-bom-buf": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", "dev": true, "requires": { "is-utf8": "0.2.1" } }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { "get-stdin": "4.0.1" } }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "supports-color": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" } }, "symbol-observable": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", "dev": true }, "table": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", "dev": true, "requires": { "ajv": "4.11.8", "ajv-keywords": "1.5.1", "chalk": "1.1.3", "lodash": "4.17.10", "slice-ansi": "0.0.4", "string-width": "2.1.1" }, "dependencies": { "ajv": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, "requires": { "co": "4.6.0", "json-stable-stringify": "1.0.1" } }, "slice-ansi": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true } } }, "term-size": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "dev": true, "requires": { "execa": "0.7.0" } }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "through2": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "dev": true, "requires": { "readable-stream": "2.3.6", "xtend": "4.0.1" } }, "time-require": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/time-require/-/time-require-0.1.2.tgz", "integrity": "sha1-+eEss3D8JgXhFARYK6VO9corLZg=", "dev": true, "requires": { "chalk": "0.4.0", "date-time": "0.1.1", "pretty-ms": "0.2.2", "text-table": "0.2.0" }, "dependencies": { "ansi-styles": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", "dev": true }, "chalk": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", "dev": true, "requires": { "ansi-styles": "1.0.0", "has-color": "0.1.7", "strip-ansi": "0.1.1" } }, "date-time": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=", "dev": true }, "parse-ms": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", "integrity": "sha1-3T+iXtbC78e93hKtm0bBY6opIk4=", "dev": true }, "pretty-ms": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", "dev": true, "requires": { "parse-ms": "0.1.2" } }, "strip-ansi": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", "dev": true } } }, "time-zone": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", "dev": true }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { "punycode": "1.4.1" } }, "travis-check-changes": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/travis-check-changes/-/travis-check-changes-0.2.0.tgz", "integrity": "sha1-60H3EgiBTgkryRR3O5SaNT0T+SI=", "dev": true, "requires": { "shelljs": "0.7.8" }, "dependencies": { "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { "glob": "7.1.2", "interpret": "1.1.0", "rechoir": "0.6.2" } } } }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, "trim-off-newlines": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { "safe-buffer": "5.1.2" } }, "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true, "optional": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "1.1.2" } }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, "uid2": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", "dev": true }, "unique-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "dev": true, "requires": { "crypto-random-string": "1.0.0" } }, "unique-temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", "dev": true, "requires": { "mkdirp": "0.5.1", "os-tmpdir": "1.0.2", "uid2": "0.0.3" } }, "unzip-response": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", "dev": true }, "update-notifier": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", "dev": true, "requires": { "boxen": "1.3.0", "chalk": "2.4.1", "configstore": "3.1.2", "import-lazy": "2.1.0", "is-ci": "1.1.0", "is-installed-globally": "0.1.0", "is-npm": "1.0.0", "latest-version": "3.1.0", "semver-diff": "2.1.0", "xdg-basedir": "3.0.0" }, "dependencies": { "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", "supports-color": "5.4.0" } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" } } } }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, "requires": { "prepend-http": "1.0.4" } }, "urlgrey": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", "dev": true }, "user-home": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", "dev": true, "requires": { "os-homedir": "1.0.2" } }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "uuid": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.0.tgz", "integrity": "sha512-ijO9N2xY/YaOqQ5yz5c4sy2ZjWmA6AR6zASb/gdpeKZ8+948CxwfMW9RrKVk5may6ev8c0/Xguu32e2Llelpqw==", "dev": true }, "validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { "spdx-correct": "3.0.0", "spdx-expression-parse": "3.0.0" } }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { "assert-plus": "1.0.0", "core-util-is": "1.0.2", "extsprintf": "1.3.0" } }, "well-known-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-1.0.0.tgz", "integrity": "sha1-c8eK6Bp3Jqj6WY4ogIAcixYiVRg=", "dev": true }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "2.0.0" } }, "widest-line": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", "dev": true, "requires": { "string-width": "2.1.1" } }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { "mkdirp": "0.5.1" } }, "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", "signal-exit": "3.0.2" } }, "write-json-file": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", "dev": true, "requires": { "detect-indent": "5.0.0", "graceful-fs": "4.1.11", "make-dir": "1.3.0", "pify": "3.0.0", "sort-keys": "2.0.0", "write-file-atomic": "2.3.0" }, "dependencies": { "detect-indent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", "dev": true }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "write-pkg": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", "dev": true, "requires": { "sort-keys": "2.0.0", "write-json-file": "2.3.0" } }, "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true } } } node-shelljs-0.8.3/package.json000066400000000000000000000035561342005425100164040ustar00rootroot00000000000000{ "name": "shelljs", "version": "0.8.3", "description": "Portable Unix shell commands for Node.js", "keywords": [ "shelljs", "bash", "unix", "shell", "makefile", "make", "jake", "synchronous" ], "contributors": [ "Nate Fischer (https://github.com/nfischer)", "Brandon Freitag (https://github.com/freitagbr)" ], "repository": { "type": "git", "url": "git://github.com/shelljs/shelljs.git" }, "license": "BSD-3-Clause", "homepage": "http://github.com/shelljs/shelljs", "main": "./shell.js", "files": [ "commands.js", "global.js", "make.js", "plugin.js", "shell.js", "bin", "src" ], "scripts": { "ci-or-install": "node scripts/ci-or-install", "posttest": "npm run lint", "test": "nyc --reporter=text --reporter=lcov ava test/*.js", "test-no-coverage": "ava test/*.js", "gendocs": "node scripts/generate-docs", "lint": "eslint .", "after-travis": "travis-check-changes", "changelog": "shelljs-changelog", "codecov": "codecov", "release:major": "shelljs-release major", "release:minor": "shelljs-release minor", "release:patch": "shelljs-release patch" }, "bin": { "shjs": "./bin/shjs" }, "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" }, "ava": { "serial": true, "powerAssert": false }, "devDependencies": { "ava": "^0.21.0", "chalk": "^1.1.3", "codecov": "^3.0.2", "coffee-script": "^1.10.0", "eslint": "^2.0.0", "eslint-config-airbnb-base": "^3.0.0", "eslint-plugin-import": "^1.11.1", "nyc": "^11.3.0", "shelljs-changelog": "^0.2.0", "shelljs-release": "^0.3.0", "shx": "^0.2.0", "travis-check-changes": "^0.2.0" }, "optionalDependencies": {}, "engines": { "node": ">=4" } } node-shelljs-0.8.3/plugin.js000066400000000000000000000007371342005425100157500ustar00rootroot00000000000000// Various utilties exposed to plugins require('./shell'); // Create the ShellJS instance (mandatory) var common = require('./src/common'); var exportedAttributes = [ 'error', // For signaling errors from within commands 'parseOptions', // For custom option parsing 'readFromPipe', // For commands with the .canReceivePipe attribute 'register', // For registering plugins ]; exportedAttributes.forEach(function (attr) { exports[attr] = common[attr]; }); node-shelljs-0.8.3/scripts/000077500000000000000000000000001342005425100155745ustar00rootroot00000000000000node-shelljs-0.8.3/scripts/ci-or-install.js000077500000000000000000000026011342005425100206110ustar00rootroot00000000000000#!/usr/bin/env node var childProcess = require('child_process'); // Note: can't use 3P modules or shelljs, because this must run before we // download dependencies. // Also, we must use exec{Sync} because `npm` is a batch script on Windows, // which must run in-process in the shell, and the 'shell' option isn't // supported on node v4. function Version(components) { this.components = components; } Version.prototype.isAtLeast = function (other) { if (this.components.length !== 3 || other.components.length !== 3) { throw new Error('version numbers must have 3 components.'); } for (var k = 0; k < this.components.length; k++) { if (this.components[k] > other.components[k]) return true; if (this.components[k] < other.components[k]) return false; } // At this point, the components must be equal. return true; }; var npmVersionComponents = childProcess.execSync('npm --version') .toString().trim().split('.').map(function (str) { return parseInt(str, 10); }); var npmVersion = new Version(npmVersionComponents); var minimumVersionWithNpmCi = new Version([5, 7, 0]); var subcommand = npmVersion.isAtLeast(minimumVersionWithNpmCi) ? 'ci' : 'install'; console.log('Executing `npm ' + subcommand + '`'); // Async. Node waits until this is finished. var c = childProcess.exec('npm ' + subcommand); c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); node-shelljs-0.8.3/scripts/generate-docs.js000077500000000000000000000020261342005425100206550ustar00rootroot00000000000000#!/usr/bin/env node /* globals cat, cd, echo, grep, sed, ShellString */ require('../global'); echo('Appending docs to README.md'); cd(__dirname + '/..'); // Extract docs from shell.js var docs = grep('^//@', 'shell.js'); // Insert the docs for all the registered commands docs = docs.replace(/\/\/@commands\n/g, function () { return require('../commands').map(function (commandName) { var file = './src/' + commandName + '.js'; return grep('^//@', file) + '\n'; }).join(''); }); // Now extract docs from the remaining src/*.js files docs = docs.replace(/\/\/@include (.+)/g, function (match, path) { var file = path.match('.js$') ? path : path + '.js'; return grep('^//@', file); }); // Remove '//@' docs = docs.replace(/\/\/@ ?/g, ''); // Wipe out the old docs ShellString(cat('README.md').replace(/## Command reference(.|\n)*\n## Team/, '## Command reference\n## Team')).to('README.md'); // Append new docs to README sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md'); echo('All done.'); node-shelljs-0.8.3/shell.js000066400000000000000000000066201342005425100155560ustar00rootroot00000000000000// // ShellJS // Unix shell commands on top of Node's API // // Copyright (c) 2012 Artur Adib // http://github.com/shelljs/shelljs // var common = require('./src/common'); //@ //@ All commands run synchronously, unless otherwise stated. //@ All commands accept standard bash globbing characters (`*`, `?`, etc.), //@ compatible with the [node `glob` module](https://github.com/isaacs/node-glob). //@ //@ For less-commonly used commands and features, please check out our [wiki //@ page](https://github.com/shelljs/shelljs/wiki). //@ // Include the docs for all the default commands //@commands // Load all default commands require('./commands').forEach(function (command) { require('./src/' + command); }); //@ //@ ### exit(code) //@ //@ Exits the current process with the given exit `code`. exports.exit = process.exit; //@include ./src/error exports.error = require('./src/error'); //@include ./src/common exports.ShellString = common.ShellString; //@ //@ ### env['VAR_NAME'] //@ //@ Object containing environment variables (both getter and setter). Shortcut //@ to `process.env`. exports.env = process.env; //@ //@ ### Pipes //@ //@ Examples: //@ //@ ```javascript //@ grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); //@ echo('files with o\'s in the name:\n' + ls().grep('o')); //@ cat('test.js').exec('node'); // pipe to exec() call //@ ``` //@ //@ Commands can send their output to another command in a pipe-like fashion. //@ `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand //@ side of a pipe. Pipes can be chained. //@ //@ ## Configuration //@ exports.config = common.config; //@ //@ ### config.silent //@ //@ Example: //@ //@ ```javascript //@ var sh = require('shelljs'); //@ var silentState = sh.config.silent; // save old silent state //@ sh.config.silent = true; //@ /* ... */ //@ sh.config.silent = silentState; // restore old silent state //@ ``` //@ //@ Suppresses all command output if `true`, except for `echo()` calls. //@ Default is `false`. //@ //@ ### config.fatal //@ //@ Example: //@ //@ ```javascript //@ require('shelljs/global'); //@ config.fatal = true; // or set('-e'); //@ cp('this_file_does_not_exist', '/dev/null'); // throws Error here //@ /* more commands... */ //@ ``` //@ //@ If `true`, the script will throw a Javascript error when any shell.js //@ command encounters an error. Default is `false`. This is analogous to //@ Bash's `set -e`. //@ //@ ### config.verbose //@ //@ Example: //@ //@ ```javascript //@ config.verbose = true; // or set('-v'); //@ cd('dir/'); //@ rm('-rf', 'foo.txt', 'bar.txt'); //@ exec('echo hello'); //@ ``` //@ //@ Will print each command as follows: //@ //@ ``` //@ cd dir/ //@ rm -rf foo.txt bar.txt //@ exec echo hello //@ ``` //@ //@ ### config.globOptions //@ //@ Example: //@ //@ ```javascript //@ config.globOptions = {nodir: true}; //@ ``` //@ //@ Use this value for calls to `glob.sync()` instead of the default options. //@ //@ ### config.reset() //@ //@ Example: //@ //@ ```javascript //@ var shell = require('shelljs'); //@ // Make changes to shell.config, and do stuff... //@ /* ... */ //@ shell.config.reset(); // reset to original state //@ // Do more stuff, but with original settings //@ /* ... */ //@ ``` //@ //@ Reset `shell.config` to the defaults: //@ //@ ```javascript //@ { //@ fatal: false, //@ globOptions: {}, //@ maxdepth: 255, //@ noglob: false, //@ silent: false, //@ verbose: false, //@ } //@ ``` node-shelljs-0.8.3/src/000077500000000000000000000000001342005425100146745ustar00rootroot00000000000000node-shelljs-0.8.3/src/cat.js000066400000000000000000000034601342005425100160040ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('cat', _cat, { canReceivePipe: true, cmdOptions: { 'n': 'number', }, }); //@ //@ ### cat([options,] file [, file ...]) //@ ### cat([options,] file_array) //@ //@ Available options: //@ //@ + `-n`: number all output lines //@ //@ Examples: //@ //@ ```javascript //@ var str = cat('file*.txt'); //@ var str = cat('file1', 'file2'); //@ var str = cat(['file1', 'file2']); // same as above //@ ``` //@ //@ Returns a string containing the given file, or a concatenated string //@ containing the files if more than one file is given (a new line character is //@ introduced between each file). function _cat(options, files) { var cat = common.readFromPipe(); if (!files && !cat) common.error('no paths given'); files = [].slice.call(arguments, 1); files.forEach(function (file) { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file); } else if (common.statFollowLinks(file).isDirectory()) { common.error(file + ': Is a directory'); } cat += fs.readFileSync(file, 'utf8'); }); if (options.number) { cat = addNumbers(cat); } return cat; } module.exports = _cat; function addNumbers(cat) { var lines = cat.split('\n'); var lastLine = lines.pop(); lines = lines.map(function (line, i) { return numberedLine(i + 1, line); }); if (lastLine.length) { lastLine = numberedLine(lines.length + 1, lastLine); } lines.push(lastLine); return lines.join('\n'); } function numberedLine(n, line) { // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart var number = (' ' + n).slice(-6) + '\t'; return number + line; } node-shelljs-0.8.3/src/cd.js000066400000000000000000000016411342005425100156220ustar00rootroot00000000000000var os = require('os'); var common = require('./common'); common.register('cd', _cd, {}); //@ //@ ### cd([dir]) //@ //@ Changes to directory `dir` for the duration of the script. Changes to home //@ directory if no argument is supplied. function _cd(options, dir) { if (!dir) dir = os.homedir(); if (dir === '-') { if (!process.env.OLDPWD) { common.error('could not find previous directory'); } else { dir = process.env.OLDPWD; } } try { var curDir = process.cwd(); process.chdir(dir); process.env.OLDPWD = curDir; } catch (e) { // something went wrong, let's figure out the error var err; try { common.statFollowLinks(dir); // if this succeeds, it must be some sort of file err = 'not a directory: ' + dir; } catch (e2) { err = 'no such file or directory: ' + dir; } if (err) common.error(err); } return ''; } module.exports = _cd; node-shelljs-0.8.3/src/chmod.js000066400000000000000000000152501342005425100163270ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); var path = require('path'); var PERMS = (function (base) { return { OTHER_EXEC: base.EXEC, OTHER_WRITE: base.WRITE, OTHER_READ: base.READ, GROUP_EXEC: base.EXEC << 3, GROUP_WRITE: base.WRITE << 3, GROUP_READ: base.READ << 3, OWNER_EXEC: base.EXEC << 6, OWNER_WRITE: base.WRITE << 6, OWNER_READ: base.READ << 6, // Literal octal numbers are apparently not allowed in "strict" javascript. STICKY: parseInt('01000', 8), SETGID: parseInt('02000', 8), SETUID: parseInt('04000', 8), TYPE_MASK: parseInt('0770000', 8), }; }({ EXEC: 1, WRITE: 2, READ: 4, })); common.register('chmod', _chmod, { }); //@ //@ ### chmod([options,] octal_mode || octal_string, file) //@ ### chmod([options,] symbolic_mode, file) //@ //@ Available options: //@ //@ + `-v`: output a diagnostic for every file processed//@ //@ + `-c`: like verbose, but report only when a change is made//@ //@ + `-R`: change files and directories recursively//@ //@ //@ Examples: //@ //@ ```javascript //@ chmod(755, '/Users/brandon'); //@ chmod('755', '/Users/brandon'); // same as above //@ chmod('u+x', '/Users/brandon'); //@ chmod('-R', 'a-w', '/Users/brandon'); //@ ``` //@ //@ Alters the permissions of a file or directory by either specifying the //@ absolute permissions in octal form or expressing the changes in symbols. //@ This command tries to mimic the POSIX behavior as much as possible. //@ Notable exceptions: //@ //@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is //@ given to the `umask`. //@ + There is no "quiet" option, since default behavior is to run silent. function _chmod(options, mode, filePattern) { if (!filePattern) { if (options.length > 0 && options.charAt(0) === '-') { // Special case where the specified file permissions started with - to subtract perms, which // get picked up by the option parser as command flags. // If we are down by one argument and options starts with -, shift everything over. [].unshift.call(arguments, ''); } else { common.error('You must specify a file.'); } } options = common.parseOptions(options, { 'R': 'recursive', 'c': 'changes', 'v': 'verbose', }); filePattern = [].slice.call(arguments, 2); var files; // TODO: replace this with a call to common.expand() if (options.recursive) { files = []; filePattern.forEach(function addFile(expandedFile) { var stat = common.statNoFollowLinks(expandedFile); if (!stat.isSymbolicLink()) { files.push(expandedFile); if (stat.isDirectory()) { // intentionally does not follow symlinks. fs.readdirSync(expandedFile).forEach(function (child) { addFile(expandedFile + '/' + child); }); } } }); } else { files = filePattern; } files.forEach(function innerChmod(file) { file = path.resolve(file); if (!fs.existsSync(file)) { common.error('File not found: ' + file); } // When recursing, don't follow symlinks. if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) { return; } var stat = common.statFollowLinks(file); var isDir = stat.isDirectory(); var perms = stat.mode; var type = perms & PERMS.TYPE_MASK; var newPerms = perms; if (isNaN(parseInt(mode, 8))) { // parse options mode.split(',').forEach(function (symbolicMode) { var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; var matches = pattern.exec(symbolicMode); if (matches) { var applyTo = matches[1]; var operator = matches[2]; var change = matches[3]; var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === ''; var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === ''; var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === ''; var changeRead = change.indexOf('r') !== -1; var changeWrite = change.indexOf('w') !== -1; var changeExec = change.indexOf('x') !== -1; var changeExecDir = change.indexOf('X') !== -1; var changeSticky = change.indexOf('t') !== -1; var changeSetuid = change.indexOf('s') !== -1; if (changeExecDir && isDir) { changeExec = true; } var mask = 0; if (changeOwner) { mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); } if (changeGroup) { mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); } if (changeOther) { mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); } // Sticky bit is special - it's not tied to user, group or other. if (changeSticky) { mask |= PERMS.STICKY; } switch (operator) { case '+': newPerms |= mask; break; case '-': newPerms &= ~mask; break; case '=': newPerms = type + mask; // According to POSIX, when using = to explicitly set the // permissions, setuid and setgid can never be cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } break; default: common.error('Could not recognize operator: `' + operator + '`'); } if (options.verbose) { console.log(file + ' -> ' + newPerms.toString(8)); } if (perms !== newPerms) { if (!options.verbose && options.changes) { console.log(file + ' -> ' + newPerms.toString(8)); } fs.chmodSync(file, newPerms); perms = newPerms; // for the next round of changes! } } else { common.error('Invalid symbolic mode change: ' + symbolicMode); } }); } else { // they gave us a full number newPerms = type + parseInt(mode, 8); // POSIX rules are that setuid and setgid can only be added using numeric // form, but not cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } fs.chmodSync(file, newPerms); } }); return ''; } module.exports = _chmod; node-shelljs-0.8.3/src/common.js000066400000000000000000000324321342005425100165260ustar00rootroot00000000000000// Ignore warning about 'new String()' /* eslint no-new-wrappers: 0 */ 'use strict'; var os = require('os'); var fs = require('fs'); var glob = require('glob'); var shell = require('..'); var shellMethods = Object.create(shell); exports.extend = Object.assign; // Check if we're running under electron var isElectron = Boolean(process.versions.electron); // Module globals (assume no execPath by default) var DEFAULT_CONFIG = { fatal: false, globOptions: {}, maxdepth: 255, noglob: false, silent: false, verbose: false, execPath: null, bufLength: 64 * 1024, // 64KB }; var config = { reset: function () { Object.assign(this, DEFAULT_CONFIG); if (!isElectron) { this.execPath = process.execPath; } }, resetForTesting: function () { this.reset(); this.silent = true; }, }; config.reset(); exports.config = config; // Note: commands should generally consider these as read-only values. var state = { error: null, errorCode: 0, currentCmd: 'shell.js', }; exports.state = state; delete process.env.OLDPWD; // initially, there's no previous directory // Reliably test if something is any sort of javascript object function isObject(a) { return typeof a === 'object' && a !== null; } exports.isObject = isObject; function log() { /* istanbul ignore next */ if (!config.silent) { console.error.apply(console, arguments); } } exports.log = log; // Converts strings to be equivalent across all platforms. Primarily responsible // for making sure we use '/' instead of '\' as path separators, but this may be // expanded in the future if necessary function convertErrorOutput(msg) { if (typeof msg !== 'string') { throw new TypeError('input must be a string'); } return msg.replace(/\\/g, '/'); } exports.convertErrorOutput = convertErrorOutput; // Shows error message. Throws if config.fatal is true function error(msg, _code, options) { // Validate input if (typeof msg !== 'string') throw new Error('msg must be a string'); var DEFAULT_OPTIONS = { continue: false, code: 1, prefix: state.currentCmd + ': ', silent: false, }; if (typeof _code === 'number' && isObject(options)) { options.code = _code; } else if (isObject(_code)) { // no 'code' options = _code; } else if (typeof _code === 'number') { // no 'options' options = { code: _code }; } else if (typeof _code !== 'number') { // only 'msg' options = {}; } options = Object.assign({}, DEFAULT_OPTIONS, options); if (!state.errorCode) state.errorCode = options.code; var logEntry = convertErrorOutput(options.prefix + msg); state.error = state.error ? state.error + '\n' : ''; state.error += logEntry; // Throw an error, or log the entry if (config.fatal) throw new Error(logEntry); if (msg.length > 0 && !options.silent) log(logEntry); if (!options.continue) { throw { msg: 'earlyExit', retValue: (new ShellString('', state.error, state.errorCode)), }; } } exports.error = error; //@ //@ ### ShellString(str) //@ //@ Examples: //@ //@ ```javascript //@ var foo = ShellString('hello world'); //@ ``` //@ //@ Turns a regular string into a string-like object similar to what each //@ command returns. This has special methods, like `.to()` and `.toEnd()`. function ShellString(stdout, stderr, code) { var that; if (stdout instanceof Array) { that = stdout; that.stdout = stdout.join('\n'); if (stdout.length > 0) that.stdout += '\n'; } else { that = new String(stdout); that.stdout = stdout; } that.stderr = stderr; that.code = code; // A list of all commands that can appear on the right-hand side of a pipe // (populated by calls to common.wrap()) pipeMethods.forEach(function (cmd) { that[cmd] = shellMethods[cmd].bind(that); }); return that; } exports.ShellString = ShellString; // Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: // parseOptions('-a', {'a':'alice', 'b':'bob'}); // Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: // parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); // Throws an error when passed a string that does not start with '-': // parseOptions('a', {'a':'alice'}); // throws function parseOptions(opt, map, errorOptions) { // Validate input if (typeof opt !== 'string' && !isObject(opt)) { throw new Error('options must be strings or key-value pairs'); } else if (!isObject(map)) { throw new Error('parseOptions() internal error: map must be an object'); } else if (errorOptions && !isObject(errorOptions)) { throw new Error('parseOptions() internal error: errorOptions must be object'); } if (opt === '--') { // This means there are no options. return {}; } // All options are false by default var options = {}; Object.keys(map).forEach(function (letter) { var optName = map[letter]; if (optName[0] !== '!') { options[optName] = false; } }); if (opt === '') return options; // defaults if (typeof opt === 'string') { if (opt[0] !== '-') { throw new Error("Options string must start with a '-'"); } // e.g. chars = ['R', 'f'] var chars = opt.slice(1).split(''); chars.forEach(function (c) { if (c in map) { var optionName = map[c]; if (optionName[0] === '!') { options[optionName.slice(1)] = false; } else { options[optionName] = true; } } else { error('option not recognized: ' + c, errorOptions || {}); } }); } else { // opt is an Object Object.keys(opt).forEach(function (key) { // key is a string of the form '-r', '-d', etc. var c = key[1]; if (c in map) { var optionName = map[c]; options[optionName] = opt[key]; // assign the given value } else { error('option not recognized: ' + c, errorOptions || {}); } }); } return options; } exports.parseOptions = parseOptions; // Expands wildcards with matching (ie. existing) file names. // For example: // expand(['file*.js']) = ['file1.js', 'file2.js', ...] // (if the files 'file1.js', 'file2.js', etc, exist in the current dir) function expand(list) { if (!Array.isArray(list)) { throw new TypeError('must be an array'); } var expanded = []; list.forEach(function (listEl) { // Don't expand non-strings if (typeof listEl !== 'string') { expanded.push(listEl); } else { var ret; try { ret = glob.sync(listEl, config.globOptions); // if nothing matched, interpret the string literally ret = ret.length > 0 ? ret : [listEl]; } catch (e) { // if glob fails, interpret the string literally ret = [listEl]; } expanded = expanded.concat(ret); } }); return expanded; } exports.expand = expand; // Normalizes Buffer creation, using Buffer.alloc if possible. // Also provides a good default buffer length for most use cases. var buffer = typeof Buffer.alloc === 'function' ? function (len) { return Buffer.alloc(len || config.bufLength); } : function (len) { return new Buffer(len || config.bufLength); }; exports.buffer = buffer; // Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. // file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 function unlinkSync(file) { try { fs.unlinkSync(file); } catch (e) { // Try to override file permission /* istanbul ignore next */ if (e.code === 'EPERM') { fs.chmodSync(file, '0666'); fs.unlinkSync(file); } else { throw e; } } } exports.unlinkSync = unlinkSync; // wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent // and improve readability function statFollowLinks() { return fs.statSync.apply(fs, arguments); } exports.statFollowLinks = statFollowLinks; function statNoFollowLinks() { return fs.lstatSync.apply(fs, arguments); } exports.statNoFollowLinks = statNoFollowLinks; // e.g. 'shelljs_a5f185d0443ca...' function randomFileName() { function randomHash(count) { if (count === 1) { return parseInt(16 * Math.random(), 10).toString(16); } var hash = ''; for (var i = 0; i < count; i++) { hash += randomHash(1); } return hash; } return 'shelljs_' + randomHash(20); } exports.randomFileName = randomFileName; // Common wrapper for all Unix-like commands that performs glob expansion, // command-logging, and other nice things function wrap(cmd, fn, options) { options = options || {}; return function () { var retValue = null; state.currentCmd = cmd; state.error = null; state.errorCode = 0; try { var args = [].slice.call(arguments, 0); // Log the command to stderr, if appropriate if (config.verbose) { console.error.apply(console, [cmd].concat(args)); } // If this is coming from a pipe, let's set the pipedValue (otherwise, set // it to the empty string) state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : ''; if (options.unix === false) { // this branch is for exec() retValue = fn.apply(this, args); } else { // and this branch is for everything else if (isObject(args[0]) && args[0].constructor.name === 'Object') { // a no-op, allowing the syntax `touch({'-r': file}, ...)` } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') { args.unshift(''); // only add dummy option if '-option' not already present } // flatten out arrays that are arguments, to make the syntax: // `cp([file1, file2, file3], dest);` // equivalent to: // `cp(file1, file2, file3, dest);` args = args.reduce(function (accum, cur) { if (Array.isArray(cur)) { return accum.concat(cur); } accum.push(cur); return accum; }, []); // Convert ShellStrings (basically just String objects) to regular strings args = args.map(function (arg) { if (isObject(arg) && arg.constructor.name === 'String') { return arg.toString(); } return arg; }); // Expand the '~' if appropriate var homeDir = os.homedir(); args = args.map(function (arg) { if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') { return arg.replace(/^~/, homeDir); } return arg; }); // Perform glob-expansion on all arguments after globStart, but preserve // the arguments before it (like regexes for sed and grep) if (!config.noglob && options.allowGlobbing === true) { args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart))); } try { // parse options if options are provided if (isObject(options.cmdOptions)) { args[0] = parseOptions(args[0], options.cmdOptions); } retValue = fn.apply(this, args); } catch (e) { /* istanbul ignore else */ if (e.msg === 'earlyExit') { retValue = e.retValue; } else { throw e; // this is probably a bug that should be thrown up the call stack } } } } catch (e) { /* istanbul ignore next */ if (!state.error) { // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... e.name = 'ShellJSInternalError'; throw e; } if (config.fatal) throw e; } if (options.wrapOutput && (typeof retValue === 'string' || Array.isArray(retValue))) { retValue = new ShellString(retValue, state.error, state.errorCode); } state.currentCmd = 'shell.js'; return retValue; }; } // wrap exports.wrap = wrap; // This returns all the input that is piped into the current command (or the // empty string, if this isn't on the right-hand side of a pipe function _readFromPipe() { return state.pipedValue; } exports.readFromPipe = _readFromPipe; var DEFAULT_WRAP_OPTIONS = { allowGlobbing: true, canReceivePipe: false, cmdOptions: null, globStart: 1, pipeOnly: false, wrapOutput: true, unix: true, }; // This is populated during plugin registration var pipeMethods = []; // Register a new ShellJS command function _register(name, implementation, wrapOptions) { wrapOptions = wrapOptions || {}; // Validate options Object.keys(wrapOptions).forEach(function (option) { if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) { throw new Error("Unknown option '" + option + "'"); } if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) { throw new TypeError("Unsupported type '" + typeof wrapOptions[option] + "' for option '" + option + "'"); } }); // If an option isn't specified, use the default wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions); if (shell[name]) { throw new Error('Command `' + name + '` already exists'); } if (wrapOptions.pipeOnly) { wrapOptions.canReceivePipe = true; shellMethods[name] = wrap(name, implementation, wrapOptions); } else { shell[name] = wrap(name, implementation, wrapOptions); } if (wrapOptions.canReceivePipe) { pipeMethods.push(name); } } exports.register = _register; node-shelljs-0.8.3/src/cp.js000066400000000000000000000230131342005425100156330ustar00rootroot00000000000000var fs = require('fs'); var path = require('path'); var common = require('./common'); common.register('cp', _cp, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', 'u': 'update', 'R': 'recursive', 'r': 'recursive', 'L': 'followsymlink', 'P': 'noFollowsymlink', }, wrapOutput: false, }); // Buffered file copy, synchronous // (Using readFileSync() + writeFileSync() could easily cause a memory overflow // with large files) function copyFileSync(srcFile, destFile, options) { if (!fs.existsSync(srcFile)) { common.error('copyFileSync: no such file or directory: ' + srcFile); } var isWindows = process.platform === 'win32'; // Check the mtimes of the files if the '-u' flag is provided try { if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) { return; } } catch (e) { // If we're here, destFile probably doesn't exist, so just do a normal copy } if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) { try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } var symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = null; var fdw = null; try { fdr = fs.openSync(srcFile, 'r'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not read src file (' + srcFile + ')'); } try { fdw = fs.openSync(destFile, 'w'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile); } while (bytesRead === bufLength) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); fs.writeSync(fdw, buf, 0, bytesRead); pos += bytesRead; } fs.closeSync(fdr); fs.closeSync(fdw); fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode); } } // Recursively copies 'sourceDir' into 'destDir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) { if (!opts) opts = {}; // Ensure there is not a run away recursive copy if (currentDepth >= common.config.maxdepth) return; currentDepth++; var isWindows = process.platform === 'win32'; // Create the directory where all our junk is moving to; read the mode of the // source directory and mirror it try { fs.mkdirSync(destDir); } catch (e) { // if the directory already exists, that's okay if (e.code !== 'EEXIST') throw e; } var files = fs.readdirSync(sourceDir); for (var i = 0; i < files.length; i++) { var srcFile = sourceDir + '/' + files[i]; var destFile = destDir + '/' + files[i]; var srcFileStat = common.statNoFollowLinks(srcFile); var symlinkFull; if (opts.followsymlink) { if (cpcheckcycle(sourceDir, srcFile)) { // Cycle link found. console.error('Cycle link found.'); symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); continue; } } if (srcFileStat.isDirectory()) { /* recursion this thing right on back. */ cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) { symlinkFull = fs.readlinkSync(srcFile); try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) { srcFileStat = common.statFollowLinks(srcFile); if (srcFileStat.isDirectory()) { cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else { copyFileSync(srcFile, destFile, opts); } } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ if (fs.existsSync(destFile) && opts.no_force) { common.log('skipping existing file: ' + files[i]); } else { copyFileSync(srcFile, destFile, opts); } } } // for files // finally change the mode for the newly created directory (otherwise, we // couldn't add files to a read-only directory). var checkDir = common.statFollowLinks(sourceDir); fs.chmodSync(destDir, checkDir.mode); } // cpdirSyncRecursive // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } function cpcheckcycle(sourceDir, srcFile) { var srcFileStat = common.statNoFollowLinks(srcFile); if (srcFileStat.isSymbolicLink()) { // Do cycle check. For example: // $ mkdir -p 1/2/3/4 // $ cd 1/2/3/4 // $ ln -s ../../3 link // $ cd ../../../.. // $ cp -RL 1 copy var cyclecheck = common.statFollowLinks(srcFile); if (cyclecheck.isDirectory()) { var sourcerealpath = fs.realpathSync(sourceDir); var symlinkrealpath = fs.realpathSync(srcFile); var re = new RegExp(symlinkrealpath); if (re.test(sourcerealpath)) { return true; } } } return false; } //@ //@ ### cp([options,] source [, source ...], dest) //@ ### cp([options,] source_array, dest) //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ + `-u`: only copy if `source` is newer than `dest` //@ + `-r`, `-R`: recursive //@ + `-L`: follow symlinks //@ + `-P`: don't follow symlinks //@ //@ Examples: //@ //@ ```javascript //@ cp('file1', 'dir1'); //@ cp('-R', 'path/to/dir/', '~/newCopy/'); //@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); //@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above //@ ``` //@ //@ Copies files. function _cp(options, sources, dest) { // If we're missing -R, it actually implies -L (unless -P is explicit) if (options.followsymlink) { options.noFollowsymlink = false; } if (!options.recursive && !options.noFollowsymlink) { options.followsymlink = true; } // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } var destExists = fs.existsSync(dest); var destStat = destExists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!destExists || !destStat.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but -n is given if (destExists && destStat.isFile() && options.no_force) { return new common.ShellString('', '', 0); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { if (src === '') src = "''"; // if src was empty string, display empty string common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } var srcStat = common.statFollowLinks(src); if (!options.noFollowsymlink && srcStat.isDirectory()) { if (!options.recursive) { // Non-Recursive common.error("omitting directory '" + src + "'", { continue: true }); } else { // Recursive // 'cp /a/source dest' should create 'source' in 'dest' var newDest = (destStat && destStat.isDirectory()) ? path.join(dest, path.basename(src)) : dest; try { common.statFollowLinks(path.dirname(dest)); cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink }); } catch (e) { /* istanbul ignore next */ common.error("cannot create directory '" + dest + "': No such file or directory"); } } } else { // If here, src is a file // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (destStat && destStat.isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (thisDestExists && options.no_force) { return; // skip file } if (path.relative(src, thisDest) === '') { // a file cannot be copied to itself, but we want to continue copying other files common.error("'" + thisDest + "' and '" + src + "' are the same file", { continue: true }); return; } copyFileSync(src, thisDest, options); } }); // forEach(src) return new common.ShellString('', common.state.error, common.state.errorCode); } module.exports = _cp; node-shelljs-0.8.3/src/dirs.js000066400000000000000000000131021342005425100161700ustar00rootroot00000000000000var common = require('./common'); var _cd = require('./cd'); var path = require('path'); common.register('dirs', _dirs, { wrapOutput: false, }); common.register('pushd', _pushd, { wrapOutput: false, }); common.register('popd', _popd, { wrapOutput: false, }); // Pushd/popd/dirs internals var _dirStack = []; function _isStackIndex(index) { return (/^[\-+]\d+$/).test(index); } function _parseStackIndex(index) { if (_isStackIndex(index)) { if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd return (/^-/).test(index) ? Number(index) - 1 : Number(index); } common.error(index + ': directory stack index out of range'); } else { common.error(index + ': invalid number'); } } function _actualDirStack() { return [process.cwd()].concat(_dirStack); } //@ //@ ### pushd([options,] [dir | '-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. //@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. //@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. //@ //@ Examples: //@ //@ ```javascript //@ // process.cwd() === '/usr' //@ pushd('/etc'); // Returns /etc /usr //@ pushd('+1'); // Returns /usr /etc //@ ``` //@ //@ Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack. function _pushd(options, dir) { if (_isStackIndex(options)) { dir = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); var dirs = _actualDirStack(); if (dir === '+0') { return dirs; // +0 is a noop } else if (!dir) { if (dirs.length > 1) { dirs = dirs.splice(1, 1).concat(dirs); } else { return common.error('no other directory'); } } else if (_isStackIndex(dir)) { var n = _parseStackIndex(dir); dirs = dirs.slice(n).concat(dirs.slice(0, n)); } else { if (options['no-cd']) { dirs.splice(1, 0, dir); } else { dirs.unshift(dir); } } if (options['no-cd']) { dirs = dirs.slice(1); } else { dir = path.resolve(dirs.shift()); _cd('', dir); } _dirStack = dirs; return _dirs(options.quiet ? '-q' : ''); } exports.pushd = _pushd; //@ //@ //@ ### popd([options,] ['-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. //@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. //@ //@ Examples: //@ //@ ```javascript //@ echo(process.cwd()); // '/usr' //@ pushd('/etc'); // '/etc /usr' //@ echo(process.cwd()); // '/etc' //@ popd(); // '/usr' //@ echo(process.cwd()); // '/usr' //@ ``` //@ //@ When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack. function _popd(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); if (!_dirStack.length) { return common.error('directory stack empty'); } index = _parseStackIndex(index || '+0'); if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { index = index > 0 ? index - 1 : index; _dirStack.splice(index, 1); } else { var dir = path.resolve(_dirStack.shift()); _cd('', dir); } return _dirs(options.quiet ? '-q' : ''); } exports.popd = _popd; //@ //@ //@ ### dirs([options | '+N' | '-N']) //@ //@ Available options: //@ //@ + `-c`: Clears the directory stack by deleting all of the elements. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. //@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. //@ //@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified. //@ //@ See also: `pushd`, `popd` function _dirs(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'c': 'clear', 'q': 'quiet', }); if (options.clear) { _dirStack = []; return _dirStack; } var stack = _actualDirStack(); if (index) { index = _parseStackIndex(index); if (index < 0) { index = stack.length + index; } if (!options.quiet) { common.log(stack[index]); } return stack[index]; } if (!options.quiet) { common.log(stack.join(' ')); } return stack; } exports.dirs = _dirs; node-shelljs-0.8.3/src/echo.js000066400000000000000000000025501342005425100161520ustar00rootroot00000000000000var format = require('util').format; var common = require('./common'); common.register('echo', _echo, { allowGlobbing: false, }); //@ //@ ### echo([options,] string [, string ...]) //@ //@ Available options: //@ //@ + `-e`: interpret backslash escapes (default) //@ + `-n`: remove trailing newline from output //@ //@ Examples: //@ //@ ```javascript //@ echo('hello world'); //@ var str = echo('hello world'); //@ echo('-n', 'no newline at end'); //@ ``` //@ //@ Prints `string` to stdout, and returns string with additional utility methods //@ like `.to()`. function _echo(opts) { // allow strings starting with '-', see issue #20 var messages = [].slice.call(arguments, opts ? 0 : 1); var options = {}; // If the first argument starts with '-', parse it as options string. // If parseOptions throws, it wasn't an options string. try { options = common.parseOptions(messages[0], { 'e': 'escapes', 'n': 'no_newline', }, { silent: true, }); // Allow null to be echoed if (messages[0]) { messages.shift(); } } catch (_) { // Clear out error if an error occurred common.state.error = null; } var output = format.apply(null, messages); // Add newline if -n is not passed. if (!options.no_newline) { output += '\n'; } process.stdout.write(output); return output; } module.exports = _echo; node-shelljs-0.8.3/src/error.js000066400000000000000000000007031342005425100163630ustar00rootroot00000000000000var common = require('./common'); //@ //@ ### error() //@ //@ Tests if error occurred in the last command. Returns a truthy value if an //@ error returned, or a falsy value otherwise. //@ //@ **Note**: do not rely on the //@ return value to be an error message. If you need the last error message, use //@ the `.stderr` attribute from the last command's return value instead. function error() { return common.state.error; } module.exports = error; node-shelljs-0.8.3/src/exec-child.js000066400000000000000000000016631342005425100172450ustar00rootroot00000000000000if (require.main !== module) { throw new Error('This file should not be required'); } var childProcess = require('child_process'); var fs = require('fs'); var paramFilePath = process.argv[2]; var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); var params = JSON.parse(serializedParams); var cmd = params.command; var execOptions = params.execOptions; var pipe = params.pipe; var stdoutFile = params.stdoutFile; var stderrFile = params.stderrFile; var c = childProcess.exec(cmd, execOptions, function (err) { if (!err) { process.exitCode = 0; } else if (err.code === undefined) { process.exitCode = 1; } else { process.exitCode = err.code; } }); var stdoutStream = fs.createWriteStream(stdoutFile); var stderrStream = fs.createWriteStream(stderrFile); c.stdout.pipe(stdoutStream); c.stderr.pipe(stderrStream); c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); if (pipe) { c.stdin.end(pipe); } node-shelljs-0.8.3/src/exec.js000066400000000000000000000146531342005425100161670ustar00rootroot00000000000000var common = require('./common'); var _tempDir = require('./tempdir').tempDir; var _pwd = require('./pwd'); var path = require('path'); var fs = require('fs'); var child = require('child_process'); var DEFAULT_MAXBUFFER_SIZE = 20 * 1024 * 1024; var DEFAULT_ERROR_CODE = 1; common.register('exec', _exec, { unix: false, canReceivePipe: true, wrapOutput: false, }); // We use this function to run `exec` synchronously while also providing realtime // output. function execSync(cmd, opts, pipe) { if (!common.config.execPath) { common.error('Unable to find a path to the node binary. Please manually set config.execPath'); } var tempDir = _tempDir(); var paramsFile = path.resolve(tempDir + '/' + common.randomFileName()); var stderrFile = path.resolve(tempDir + '/' + common.randomFileName()); var stdoutFile = path.resolve(tempDir + '/' + common.randomFileName()); opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); opts.cwd = path.resolve(opts.cwd); var paramsToSerialize = { command: cmd, execOptions: opts, pipe: pipe, stdoutFile: stdoutFile, stderrFile: stderrFile, }; fs.writeFileSync(paramsFile, JSON.stringify(paramsToSerialize), 'utf8'); var execArgs = [ path.join(__dirname, 'exec-child.js'), paramsFile, ]; /* istanbul ignore else */ if (opts.silent) { opts.stdio = 'ignore'; } else { opts.stdio = [0, 1, 2]; } var code = 0; // Welcome to the future try { // Bad things if we pass in a `shell` option to child_process.execFileSync, // so we need to explicitly remove it here. delete opts.shell; child.execFileSync(common.config.execPath, execArgs, opts); } catch (e) { // Commands with non-zero exit code raise an exception. code = e.status || DEFAULT_ERROR_CODE; } // fs.readFileSync uses buffer encoding by default, so call // it without the encoding option if the encoding is 'buffer'. // Also, if the exec timeout is too short for node to start up, // the files will not be created, so these calls will throw. var stdout = ''; var stderr = ''; if (opts.encoding === 'buffer') { stdout = fs.readFileSync(stdoutFile); stderr = fs.readFileSync(stderrFile); } else { stdout = fs.readFileSync(stdoutFile, opts.encoding); stderr = fs.readFileSync(stderrFile, opts.encoding); } // No biggie if we can't erase the files now -- they're in a temp dir anyway try { common.unlinkSync(paramsFile); } catch (e) {} try { common.unlinkSync(stderrFile); } catch (e) {} try { common.unlinkSync(stdoutFile); } catch (e) {} if (code !== 0) { // Note: `silent` should be unconditionally true to avoid double-printing // the command's stderr, and to avoid printing any stderr when the user has // set `shell.config.silent`. common.error(stderr, code, { continue: true, silent: true }); } var obj = common.ShellString(stdout, stderr, code); return obj; } // execSync() // Wrapper around exec() to enable echoing output to console in real time function execAsync(cmd, opts, pipe, callback) { opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); var c = child.exec(cmd, opts, function (err, stdout, stderr) { if (callback) { if (!err) { callback(0, stdout, stderr); } else if (err.code === undefined) { // See issue #536 /* istanbul ignore next */ callback(1, stdout, stderr); } else { callback(err.code, stdout, stderr); } } }); if (pipe) c.stdin.end(pipe); if (!opts.silent) { c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); } return c; } //@ //@ ### exec(command [, options] [, callback]) //@ //@ Available options: //@ //@ + `async`: Asynchronous execution. If a callback is provided, it will be set to //@ `true`, regardless of the passed value (default: `false`). //@ + `silent`: Do not echo program output to console (default: `false`). //@ + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and //@ what is written to stdout and stderr when not in silent mode (default: `'utf8'`). //@ + and any option available to Node.js's //@ [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) //@ //@ Examples: //@ //@ ```javascript //@ var version = exec('node --version', {silent:true}).stdout; //@ //@ var child = exec('some_long_running_process', {async:true}); //@ child.stdout.on('data', function(data) { //@ /* ... do something with data ... */ //@ }); //@ //@ exec('some_long_running_process', function(code, stdout, stderr) { //@ console.log('Exit code:', code); //@ console.log('Program output:', stdout); //@ console.log('Program stderr:', stderr); //@ }); //@ ``` //@ //@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous //@ mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object //@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process //@ object, and the `callback` receives the arguments `(code, stdout, stderr)`. //@ //@ Not seeing the behavior you want? `exec()` runs everything through `sh` //@ by default (or `cmd.exe` on Windows), which differs from `bash`. If you //@ need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. function _exec(command, options, callback) { options = options || {}; if (!command) common.error('must specify command'); var pipe = common.readFromPipe(); // Callback is defined instead of options. if (typeof options === 'function') { callback = options; options = { async: true }; } // Callback is defined with options. if (typeof options === 'object' && typeof callback === 'function') { options.async = true; } options = common.extend({ silent: common.config.silent, async: false, }, options); if (options.async) { return execAsync(command, options, pipe, callback); } else { return execSync(command, options, pipe); } } module.exports = _exec; node-shelljs-0.8.3/src/find.js000066400000000000000000000030211342005425100161460ustar00rootroot00000000000000var path = require('path'); var common = require('./common'); var _ls = require('./ls'); common.register('find', _find, {}); //@ //@ ### find(path [, path ...]) //@ ### find(path_array) //@ //@ Examples: //@ //@ ```javascript //@ find('src', 'lib'); //@ find(['src', 'lib']); // same as above //@ find('.').filter(function(file) { return file.match(/\.js$/); }); //@ ``` //@ //@ Returns array of all files (however deep) in the given paths. //@ //@ The main difference from `ls('-R', path)` is that the resulting file names //@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`). function _find(options, paths) { if (!paths) { common.error('no path specified'); } else if (typeof paths === 'string') { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(file) { if (process.platform === 'win32') { file = file.replace(/\\/g, '/'); } list.push(file); } // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory paths.forEach(function (file) { var stat; try { stat = common.statFollowLinks(file); } catch (e) { common.error('no such file or directory: ' + file); } pushFile(file); if (stat.isDirectory()) { _ls({ recursive: true, all: true }, file).forEach(function (subfile) { pushFile(path.join(file, subfile)); }); } }); return list; } module.exports = _find; node-shelljs-0.8.3/src/grep.js000066400000000000000000000034501342005425100161710ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('grep', _grep, { globStart: 2, // don't glob-expand the regex canReceivePipe: true, cmdOptions: { 'v': 'inverse', 'l': 'nameOnly', 'i': 'ignoreCase', }, }); //@ //@ ### grep([options,] regex_filter, file [, file ...]) //@ ### grep([options,] regex_filter, file_array) //@ //@ Available options: //@ //@ + `-v`: Invert `regex_filter` (only print non-matching lines). //@ + `-l`: Print only filenames of matching files. //@ + `-i`: Ignore case. //@ //@ Examples: //@ //@ ```javascript //@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); //@ grep('GLOBAL_VARIABLE', '*.js'); //@ ``` //@ //@ Reads input string from given files and returns a string containing all lines of the //@ file that match the given `regex_filter`. function _grep(options, regex, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given', 2); files = [].slice.call(arguments, 2); if (pipe) { files.unshift('-'); } var grep = []; if (options.ignoreCase) { regex = new RegExp(regex, 'i'); } files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); if (options.nameOnly) { if (contents.match(regex)) { grep.push(file); } } else { var lines = contents.split('\n'); lines.forEach(function (line) { var matched = line.match(regex); if ((options.inverse && !matched) || (!options.inverse && matched)) { grep.push(line); } }); } }); return grep.join('\n') + '\n'; } module.exports = _grep; node-shelljs-0.8.3/src/head.js000066400000000000000000000051741342005425100161420ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('head', _head, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); // Reads |numLines| lines or the entire file, whichever is less. function readSomeLines(file, numLines) { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = fs.openSync(file, 'r'); var numLinesRead = 0; var ret = ''; while (bytesRead === bufLength && numLinesRead < numLines) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); var bufStr = buf.toString('utf8', 0, bytesRead); numLinesRead += bufStr.split('\n').length - 1; ret += bufStr; pos += bytesRead; } fs.closeSync(fdr); return ret; } //@ //@ ### head([{'-n': \},] file [, file ...]) //@ ### head([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the first `` lines of the files //@ //@ Examples: //@ //@ ```javascript //@ var str = head({'-n': 1}, 'file*.txt'); //@ var str = head('file1', 'file2'); //@ var str = head(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the start of a file. function _head(options, files) { var head = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents; if (file === '-') { contents = pipe; } else if (options.numLines < 0) { contents = fs.readFileSync(file, 'utf8'); } else { contents = readSomeLines(file, options.numLines); } var lines = contents.split('\n'); var hasTrailingNewline = (lines[lines.length - 1] === ''); if (hasTrailingNewline) { lines.pop(); } shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length); head = head.concat(lines.slice(0, options.numLines)); }); if (shouldAppendNewline) { head.push(''); // to add a trailing newline once we join } return head.join('\n'); } module.exports = _head; node-shelljs-0.8.3/src/ln.js000066400000000000000000000035361342005425100156520ustar00rootroot00000000000000var fs = require('fs'); var path = require('path'); var common = require('./common'); common.register('ln', _ln, { cmdOptions: { 's': 'symlink', 'f': 'force', }, }); //@ //@ ### ln([options,] source, dest) //@ //@ Available options: //@ //@ + `-s`: symlink //@ + `-f`: force //@ //@ Examples: //@ //@ ```javascript //@ ln('file', 'newlink'); //@ ln('-sf', 'file', 'existing'); //@ ``` //@ //@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. function _ln(options, source, dest) { if (!source || !dest) { common.error('Missing and/or '); } source = String(source); var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); var isAbsolute = (path.resolve(source) === sourcePath); dest = path.resolve(process.cwd(), String(dest)); if (fs.existsSync(dest)) { if (!options.force) { common.error('Destination file exists', { continue: true }); } fs.unlinkSync(dest); } if (options.symlink) { var isWindows = process.platform === 'win32'; var linkType = isWindows ? 'file' : null; var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); if (!fs.existsSync(resolvedSourcePath)) { common.error('Source file does not exist', { continue: true }); } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) { linkType = 'junction'; } try { fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType); } catch (err) { common.error(err.message); } } else { if (!fs.existsSync(source)) { common.error('Source file does not exist', { continue: true }); } try { fs.linkSync(source, dest); } catch (err) { common.error(err.message); } } return ''; } module.exports = _ln; node-shelljs-0.8.3/src/ls.js000066400000000000000000000103721342005425100156530ustar00rootroot00000000000000var path = require('path'); var fs = require('fs'); var common = require('./common'); var glob = require('glob'); var globPatternRecursive = path.sep + '**'; common.register('ls', _ls, { cmdOptions: { 'R': 'recursive', 'A': 'all', 'L': 'link', 'a': 'all_deprecated', 'd': 'directory', 'l': 'long', }, }); //@ //@ ### ls([options,] [path, ...]) //@ ### ls([options,] path_array) //@ //@ Available options: //@ //@ + `-R`: recursive //@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) //@ + `-L`: follow symlinks //@ + `-d`: list directories themselves, not their contents //@ + `-l`: list objects representing each file, each with fields containing `ls //@ -l` output fields. See //@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) //@ for more info //@ //@ Examples: //@ //@ ```javascript //@ ls('projs/*.js'); //@ ls('-R', '/users/me', '/tmp'); //@ ls('-R', ['/users/me', '/tmp']); // same as above //@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} //@ ``` //@ //@ Returns array of files in the given `path`, or files in //@ the current directory if no `path` is provided. function _ls(options, paths) { if (options.all_deprecated) { // We won't support the -a option as it's hard to image why it's useful // (it includes '.' and '..' in addition to '.*' files) // For backwards compatibility we'll dump a deprecated message and proceed as before common.log('ls: Option -a is deprecated. Use -A instead'); options.all = true; } if (!paths) { paths = ['.']; } else { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(abs, relName, stat) { if (process.platform === 'win32') { relName = relName.replace(/\\/g, '/'); } if (options.long) { stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs)); list.push(addLsAttributes(relName, stat)); } else { // list.push(path.relative(rel || '.', file)); list.push(relName); } } paths.forEach(function (p) { var stat; try { stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p); // follow links to directories by default if (stat.isSymbolicLink()) { /* istanbul ignore next */ // workaround for https://github.com/shelljs/shelljs/issues/795 // codecov seems to have a bug that miscalculate this block as uncovered. // but according to nyc report this block does get covered. try { var _stat = common.statFollowLinks(p); if (_stat.isDirectory()) { stat = _stat; } } catch (_) {} // bad symlink, treat it like a file } } catch (e) { common.error('no such file or directory: ' + p, 2, { continue: true }); return; } // If the stat succeeded if (stat.isDirectory() && !options.directory) { if (options.recursive) { // use glob, because it's simple glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link }) .forEach(function (item) { // Glob pattern returns the directory itself and needs to be filtered out. if (path.relative(p, item)) { pushFile(item, path.relative(p, item)); } }); } else if (options.all) { // use fs.readdirSync, because it's fast fs.readdirSync(p).forEach(function (item) { pushFile(path.join(p, item), item); }); } else { // use fs.readdirSync and then filter out secret files fs.readdirSync(p).forEach(function (item) { if (item[0] !== '.') { pushFile(path.join(p, item), item); } }); } } else { pushFile(p, p, stat); } }); // Add methods, to make this more compatible with ShellStrings return list; } function addLsAttributes(pathName, stats) { // Note: this object will contain more information than .toString() returns stats.name = pathName; stats.toString = function () { // Return a string resembling unix's `ls -l` format return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); }; return stats; } module.exports = _ls; node-shelljs-0.8.3/src/mkdir.js000066400000000000000000000050531342005425100163430ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); var path = require('path'); common.register('mkdir', _mkdir, { cmdOptions: { 'p': 'fullpath', }, }); // Recursively creates `dir` function mkdirSyncRecursive(dir) { var baseDir = path.dirname(dir); // Prevents some potential problems arising from malformed UNCs or // insufficient permissions. /* istanbul ignore next */ if (baseDir === dir) { common.error('dirname() failed: [' + dir + ']'); } // Base dir exists, no recursion necessary if (fs.existsSync(baseDir)) { fs.mkdirSync(dir, parseInt('0777', 8)); return; } // Base dir does not exist, go recursive mkdirSyncRecursive(baseDir); // Base dir created, can create dir fs.mkdirSync(dir, parseInt('0777', 8)); } //@ //@ ### mkdir([options,] dir [, dir ...]) //@ ### mkdir([options,] dir_array) //@ //@ Available options: //@ //@ + `-p`: full path (and create intermediate directories, if necessary) //@ //@ Examples: //@ //@ ```javascript //@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); //@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above //@ ``` //@ //@ Creates directories. function _mkdir(options, dirs) { if (!dirs) common.error('no paths given'); if (typeof dirs === 'string') { dirs = [].slice.call(arguments, 1); } // if it's array leave it as it is dirs.forEach(function (dir) { try { var stat = common.statNoFollowLinks(dir); if (!options.fullpath) { common.error('path already exists: ' + dir, { continue: true }); } else if (stat.isFile()) { common.error('cannot create directory ' + dir + ': File exists', { continue: true }); } return; // skip dir } catch (e) { // do nothing } // Base dir does not exist, and no -p option given var baseDir = path.dirname(dir); if (!fs.existsSync(baseDir) && !options.fullpath) { common.error('no such file or directory: ' + baseDir, { continue: true }); return; // skip dir } try { if (options.fullpath) { mkdirSyncRecursive(path.resolve(dir)); } else { fs.mkdirSync(dir, parseInt('0777', 8)); } } catch (e) { var reason; if (e.code === 'EACCES') { reason = 'Permission denied'; } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') { reason = 'Not a directory'; } else { /* istanbul ignore next */ throw e; } common.error('cannot create directory ' + dir + ': ' + reason, { continue: true }); } }); return ''; } // mkdir module.exports = _mkdir; node-shelljs-0.8.3/src/mv.js000066400000000000000000000067701342005425100156660ustar00rootroot00000000000000var fs = require('fs'); var path = require('path'); var common = require('./common'); var cp = require('./cp'); var rm = require('./rm'); common.register('mv', _mv, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', }, }); // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } //@ //@ ### mv([options ,] source [, source ...], dest') //@ ### mv([options ,] source_array, dest') //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ //@ Examples: //@ //@ ```javascript //@ mv('-n', 'file', 'dir/'); //@ mv('file1', 'file2', 'dir/'); //@ mv(['file1', 'file2'], 'dir/'); // same as above //@ ``` //@ //@ Moves `source` file(s) to `dest`. function _mv(options, sources, dest) { // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else if (arguments.length > 3) { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } else if (typeof sources === 'string') { sources = [sources]; } else { // TODO(nate): figure out if we actually need this line common.error('invalid arguments'); } var exists = fs.existsSync(dest); var stats = exists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!exists || !stats.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but no -f given if (exists && stats.isFile() && options.no_force) { common.error('dest file already exists: ' + dest); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } // If here, src exists // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (fs.existsSync(thisDest) && options.no_force) { common.error('dest file already exists: ' + thisDest, { continue: true }); return; // skip file } if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { common.error('cannot move to self: ' + src, { continue: true }); return; // skip file } try { fs.renameSync(src, thisDest); } catch (e) { /* istanbul ignore next */ if (e.code === 'EXDEV') { // If we're trying to `mv` to an external partition, we'll actually need // to perform a copy and then clean up the original file. If either the // copy or the rm fails with an exception, we should allow this // exception to pass up to the top level. cp('-r', src, thisDest); rm('-rf', src); } } }); // forEach(src) return ''; } // mv module.exports = _mv; node-shelljs-0.8.3/src/popd.js000066400000000000000000000000171342005425100161720ustar00rootroot00000000000000// see dirs.js node-shelljs-0.8.3/src/pushd.js000066400000000000000000000000171342005425100163530ustar00rootroot00000000000000// see dirs.js node-shelljs-0.8.3/src/pwd.js000066400000000000000000000004261342005425100160260ustar00rootroot00000000000000var path = require('path'); var common = require('./common'); common.register('pwd', _pwd, { allowGlobbing: false, }); //@ //@ ### pwd() //@ //@ Returns the current directory. function _pwd() { var pwd = path.resolve(process.cwd()); return pwd; } module.exports = _pwd; node-shelljs-0.8.3/src/rm.js000066400000000000000000000127621342005425100156600ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('rm', _rm, { cmdOptions: { 'f': 'force', 'r': 'recursive', 'R': 'recursive', }, }); // Recursively removes 'dir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function rmdirSyncRecursive(dir, force, fromSymlink) { var files; files = fs.readdirSync(dir); // Loop through and delete everything in the sub-tree after checking it for (var i = 0; i < files.length; i++) { var file = dir + '/' + files[i]; var currFile = common.statNoFollowLinks(file); if (currFile.isDirectory()) { // Recursive function back to the beginning rmdirSyncRecursive(file, force); } else { // Assume it's a file - perhaps a try/catch belongs here? if (force || isWriteable(file)) { try { common.unlinkSync(file); } catch (e) { /* istanbul ignore next */ common.error('could not remove file (code ' + e.code + '): ' + file, { continue: true, }); } } } } // if was directory was referenced through a symbolic link, // the contents should be removed, but not the directory itself if (fromSymlink) return; // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. // Huzzah for the shopkeep. var result; try { // Retry on windows, sometimes it takes a little time before all the files in the directory are gone var start = Date.now(); // TODO: replace this with a finite loop for (;;) { try { result = fs.rmdirSync(dir); if (fs.existsSync(dir)) throw { code: 'EAGAIN' }; break; } catch (er) { /* istanbul ignore next */ // In addition to error codes, also check if the directory still exists and loop again if true if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) { if (Date.now() - start > 1000) throw er; } else if (er.code === 'ENOENT') { // Directory did not exist, deletion was successful break; } else { throw er; } } } } catch (e) { common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true }); } return result; } // rmdirSyncRecursive // Hack to determine if file has write permissions for current user // Avoids having to check user, group, etc, but it's probably slow function isWriteable(file) { var writePermission = true; try { var __fd = fs.openSync(file, 'a'); fs.closeSync(__fd); } catch (e) { writePermission = false; } return writePermission; } function handleFile(file, options) { if (options.force || isWriteable(file)) { // -f was passed, or file is writable, so it can be removed common.unlinkSync(file); } else { common.error('permission denied: ' + file, { continue: true }); } } function handleDirectory(file, options) { if (options.recursive) { // -r was passed, so directory can be removed rmdirSyncRecursive(file, options.force); } else { common.error('path is a directory', { continue: true }); } } function handleSymbolicLink(file, options) { var stats; try { stats = common.statFollowLinks(file); } catch (e) { // symlink is broken, so remove the symlink itself common.unlinkSync(file); return; } if (stats.isFile()) { common.unlinkSync(file); } else if (stats.isDirectory()) { if (file[file.length - 1] === '/') { // trailing separator, so remove the contents, not the link if (options.recursive) { // -r was passed, so directory can be removed var fromSymlink = true; rmdirSyncRecursive(file, options.force, fromSymlink); } else { common.error('path is a directory', { continue: true }); } } else { // no trailing separator, so remove the link common.unlinkSync(file); } } } function handleFIFO(file) { common.unlinkSync(file); } //@ //@ ### rm([options,] file [, file ...]) //@ ### rm([options,] file_array) //@ //@ Available options: //@ //@ + `-f`: force //@ + `-r, -R`: recursive //@ //@ Examples: //@ //@ ```javascript //@ rm('-rf', '/tmp/*'); //@ rm('some_file.txt', 'another_file.txt'); //@ rm(['some_file.txt', 'another_file.txt']); // same as above //@ ``` //@ //@ Removes files. function _rm(options, files) { if (!files) common.error('no paths given'); // Convert to array files = [].slice.call(arguments, 1); files.forEach(function (file) { var lstats; try { var filepath = (file[file.length - 1] === '/') ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks : file; lstats = common.statNoFollowLinks(filepath); // test for existence } catch (e) { // Path does not exist, no force flag given if (!options.force) { common.error('no such file or directory: ' + file, { continue: true }); } return; // skip file } // If here, path exists if (lstats.isFile()) { handleFile(file, options); } else if (lstats.isDirectory()) { handleDirectory(file, options); } else if (lstats.isSymbolicLink()) { handleSymbolicLink(file, options); } else if (lstats.isFIFO()) { handleFIFO(file); } }); // forEach(file) return ''; } // rm module.exports = _rm; node-shelljs-0.8.3/src/sed.js000066400000000000000000000043221342005425100160060ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('sed', _sed, { globStart: 3, // don't glob-expand regexes canReceivePipe: true, cmdOptions: { 'i': 'inplace', }, }); //@ //@ ### sed([options,] search_regex, replacement, file [, file ...]) //@ ### sed([options,] search_regex, replacement, file_array) //@ //@ Available options: //@ //@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ //@ //@ Examples: //@ //@ ```javascript //@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); //@ ``` //@ //@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input //@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. //@ //@ Note: //@ //@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified //@ using the `$n` syntax: //@ //@ ```javascript //@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); //@ ``` function _sed(options, regex, replacement, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (typeof replacement !== 'string' && typeof replacement !== 'function') { if (typeof replacement === 'number') { replacement = replacement.toString(); // fallback } else { common.error('invalid replacement string'); } } // Convert all search strings to RegExp if (typeof regex === 'string') { regex = RegExp(regex); } if (!files && !pipe) { common.error('no files given'); } files = [].slice.call(arguments, 3); if (pipe) { files.unshift('-'); } var sed = []; files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); var result = lines.map(function (line) { return line.replace(regex, replacement); }).join('\n'); sed.push(result); if (options.inplace) { fs.writeFileSync(file, result, 'utf8'); } }); return sed.join('\n'); } module.exports = _sed; node-shelljs-0.8.3/src/set.js000066400000000000000000000025331342005425100160300ustar00rootroot00000000000000var common = require('./common'); common.register('set', _set, { allowGlobbing: false, wrapOutput: false, }); //@ //@ ### set(options) //@ //@ Available options: //@ //@ + `+/-e`: exit upon error (`config.fatal`) //@ + `+/-v`: verbose: show all commands (`config.verbose`) //@ + `+/-f`: disable filename expansion (globbing) //@ //@ Examples: //@ //@ ```javascript //@ set('-e'); // exit upon first error //@ set('+e'); // this undoes a "set('-e')" //@ ``` //@ //@ Sets global configuration variables. function _set(options) { if (!options) { var args = [].slice.call(arguments, 0); if (args.length < 2) common.error('must provide an argument'); options = args[1]; } var negate = (options[0] === '+'); if (negate) { options = '-' + options.slice(1); // parseOptions needs a '-' prefix } options = common.parseOptions(options, { 'e': 'fatal', 'v': 'verbose', 'f': 'noglob', }); if (negate) { Object.keys(options).forEach(function (key) { options[key] = !options[key]; }); } Object.keys(options).forEach(function (key) { // Only change the global config if `negate` is false and the option is true // or if `negate` is true and the option is false (aka negate !== option) if (negate !== options[key]) { common.config[key] = options[key]; } }); return; } module.exports = _set; node-shelljs-0.8.3/src/sort.js000066400000000000000000000047761342005425100162370ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('sort', _sort, { canReceivePipe: true, cmdOptions: { 'r': 'reverse', 'n': 'numerical', }, }); // parse out the number prefix of a line function parseNumber(str) { var match = str.match(/^\s*(\d*)\s*(.*)$/); return { num: Number(match[1]), value: match[2] }; } // compare two strings case-insensitively, but examine case for strings that are // case-insensitive equivalent function unixCmp(a, b) { var aLower = a.toLowerCase(); var bLower = b.toLowerCase(); return (aLower === bLower ? -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does aLower.localeCompare(bLower)); } // compare two strings in the fashion that unix sort's -n option works function numericalCmp(a, b) { var objA = parseNumber(a); var objB = parseNumber(b); if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) { return ((objA.num !== objB.num) ? (objA.num - objB.num) : unixCmp(objA.value, objB.value)); } else { return unixCmp(objA.value, objB.value); } } //@ //@ ### sort([options,] file [, file ...]) //@ ### sort([options,] file_array) //@ //@ Available options: //@ //@ + `-r`: Reverse the results //@ + `-n`: Compare according to numerical value //@ //@ Examples: //@ //@ ```javascript //@ sort('foo.txt', 'bar.txt'); //@ sort('-r', 'foo.txt'); //@ ``` //@ //@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple //@ files mixes their content (just as unix `sort` does). function _sort(options, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no files given'); files = [].slice.call(arguments, 1); if (pipe) { files.unshift('-'); } var lines = files.reduce(function (accum, file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return accum; } else if (common.statFollowLinks(file).isDirectory()) { common.error('read failed: ' + file + ': Is a directory', { continue: true, }); return accum; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); return accum.concat(contents.trimRight().split('\n')); }, []); var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp); if (options.reverse) { sorted = sorted.reverse(); } return sorted.join('\n') + '\n'; } module.exports = _sort; node-shelljs-0.8.3/src/tail.js000066400000000000000000000036121342005425100161650ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('tail', _tail, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); //@ //@ ### tail([{'-n': \},] file [, file ...]) //@ ### tail([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the last `` lines of `file`s //@ //@ Examples: //@ //@ ```javascript //@ var str = tail({'-n': 1}, 'file*.txt'); //@ var str = tail('file1', 'file2'); //@ var str = tail(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the end of a `file`. function _tail(options, files) { var tail = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } options.numLines = -1 * Math.abs(options.numLines); files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); if (lines[lines.length - 1] === '') { lines.pop(); shouldAppendNewline = true; } else { shouldAppendNewline = false; } tail = tail.concat(lines.slice(options.numLines)); }); if (shouldAppendNewline) { tail.push(''); // to add a trailing newline once we join } return tail.join('\n'); } module.exports = _tail; node-shelljs-0.8.3/src/tempdir.js000066400000000000000000000043151342005425100167010ustar00rootroot00000000000000var common = require('./common'); var os = require('os'); var fs = require('fs'); common.register('tempdir', _tempDir, { allowGlobbing: false, wrapOutput: false, }); // Returns false if 'dir' is not a writeable directory, 'dir' otherwise function writeableDir(dir) { if (!dir || !fs.existsSync(dir)) return false; if (!common.statFollowLinks(dir).isDirectory()) return false; var testFile = dir + '/' + common.randomFileName(); try { fs.writeFileSync(testFile, ' '); common.unlinkSync(testFile); return dir; } catch (e) { /* istanbul ignore next */ return false; } } // Variable to cache the tempdir value for successive lookups. var cachedTempDir; //@ //@ ### tempdir() //@ //@ Examples: //@ //@ ```javascript //@ var tmp = tempdir(); // "/tmp" for most *nix platforms //@ ``` //@ //@ Searches and returns string containing a writeable, platform-dependent temporary directory. //@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). function _tempDir() { if (cachedTempDir) return cachedTempDir; cachedTempDir = writeableDir(os.tmpdir()) || writeableDir(process.env.TMPDIR) || writeableDir(process.env.TEMP) || writeableDir(process.env.TMP) || writeableDir(process.env.Wimp$ScrapDir) || // RiscOS writeableDir('C:\\TEMP') || // Windows writeableDir('C:\\TMP') || // Windows writeableDir('\\TEMP') || // Windows writeableDir('\\TMP') || // Windows writeableDir('/tmp') || writeableDir('/var/tmp') || writeableDir('/usr/tmp') || writeableDir('.'); // last resort return cachedTempDir; } // Indicates if the tempdir value is currently cached. This is exposed for tests // only. The return value should only be tested for truthiness. function isCached() { return cachedTempDir; } // Clears the cached tempDir value, if one is cached. This is exposed for tests // only. function clearCache() { cachedTempDir = undefined; } module.exports.tempDir = _tempDir; module.exports.isCached = isCached; module.exports.clearCache = clearCache; node-shelljs-0.8.3/src/test.js000066400000000000000000000040371342005425100162150ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('test', _test, { cmdOptions: { 'b': 'block', 'c': 'character', 'd': 'directory', 'e': 'exists', 'f': 'file', 'L': 'link', 'p': 'pipe', 'S': 'socket', }, wrapOutput: false, allowGlobbing: false, }); //@ //@ ### test(expression) //@ //@ Available expression primaries: //@ //@ + `'-b', 'path'`: true if path is a block device //@ + `'-c', 'path'`: true if path is a character device //@ + `'-d', 'path'`: true if path is a directory //@ + `'-e', 'path'`: true if path exists //@ + `'-f', 'path'`: true if path is a regular file //@ + `'-L', 'path'`: true if path is a symbolic link //@ + `'-p', 'path'`: true if path is a pipe (FIFO) //@ + `'-S', 'path'`: true if path is a socket //@ //@ Examples: //@ //@ ```javascript //@ if (test('-d', path)) { /* do something with dir */ }; //@ if (!test('-f', path)) continue; // skip if it's a regular file //@ ``` //@ //@ Evaluates `expression` using the available primaries and returns corresponding value. function _test(options, path) { if (!path) common.error('no path given'); var canInterpret = false; Object.keys(options).forEach(function (key) { if (options[key] === true) { canInterpret = true; } }); if (!canInterpret) common.error('could not interpret expression'); if (options.link) { try { return common.statNoFollowLinks(path).isSymbolicLink(); } catch (e) { return false; } } if (!fs.existsSync(path)) return false; if (options.exists) return true; var stats = common.statFollowLinks(path); if (options.block) return stats.isBlockDevice(); if (options.character) return stats.isCharacterDevice(); if (options.directory) return stats.isDirectory(); if (options.file) return stats.isFile(); /* istanbul ignore next */ if (options.pipe) return stats.isFIFO(); /* istanbul ignore next */ if (options.socket) return stats.isSocket(); /* istanbul ignore next */ return false; // fallback } // test module.exports = _test; node-shelljs-0.8.3/src/to.js000066400000000000000000000017031342005425100156550ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); var path = require('path'); common.register('to', _to, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.to(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').to('output.txt'); //@ ``` //@ //@ Analogous to the redirection operator `>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix //@ redirections, `to()` will overwrite any existing file!_ function _to(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _to; node-shelljs-0.8.3/src/toEnd.js000066400000000000000000000016311342005425100163040ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); var path = require('path'); common.register('toEnd', _toEnd, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.toEnd(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').toEnd('output.txt'); //@ ``` //@ //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). function _toEnd(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _toEnd; node-shelljs-0.8.3/src/touch.js000066400000000000000000000052341342005425100163600ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); common.register('touch', _touch, { cmdOptions: { 'a': 'atime_only', 'c': 'no_create', 'd': 'date', 'm': 'mtime_only', 'r': 'reference', }, }); //@ //@ ### touch([options,] file [, file ...]) //@ ### touch([options,] file_array) //@ //@ Available options: //@ //@ + `-a`: Change only the access time //@ + `-c`: Do not create any files //@ + `-m`: Change only the modification time //@ + `-d DATE`: Parse `DATE` and use it instead of current time //@ + `-r FILE`: Use `FILE`'s times instead of current time //@ //@ Examples: //@ //@ ```javascript //@ touch('source.js'); //@ touch('-c', '/path/to/some/dir/source.js'); //@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); //@ ``` //@ //@ Update the access and modification times of each `FILE` to the current time. //@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied. //@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). function _touch(opts, files) { if (!files) { common.error('no files given'); } else if (typeof files === 'string') { files = [].slice.call(arguments, 1); } else { common.error('file arg should be a string file path or an Array of string file paths'); } files.forEach(function (f) { touchFile(opts, f); }); return ''; } function touchFile(opts, file) { var stat = tryStatFile(file); if (stat && stat.isDirectory()) { // don't error just exit return; } // if the file doesn't already exist and the user has specified --no-create then // this script is finished if (!stat && opts.no_create) { return; } // open the file and then close it. this will create it if it doesn't exist but will // not truncate the file fs.closeSync(fs.openSync(file, 'a')); // // Set timestamps // // setup some defaults var now = new Date(); var mtime = opts.date || now; var atime = opts.date || now; // use reference file if (opts.reference) { var refStat = tryStatFile(opts.reference); if (!refStat) { common.error('failed to get attributess of ' + opts.reference); } mtime = refStat.mtime; atime = refStat.atime; } else if (opts.date) { mtime = opts.date; atime = opts.date; } if (opts.atime_only && opts.mtime_only) { // keep the new values of mtime and atime like GNU } else if (opts.atime_only) { mtime = stat.mtime; } else if (opts.mtime_only) { atime = stat.atime; } fs.utimesSync(file, atime, mtime); } module.exports = _touch; function tryStatFile(filePath) { try { return common.statFollowLinks(filePath); } catch (e) { return null; } } node-shelljs-0.8.3/src/uniq.js000066400000000000000000000047771342005425100162250ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); // add c spaces to the left of str function lpad(c, str) { var res = '' + str; if (res.length < c) { res = Array((c - res.length) + 1).join(' ') + res; } return res; } common.register('uniq', _uniq, { canReceivePipe: true, cmdOptions: { 'i': 'ignoreCase', 'c': 'count', 'd': 'duplicates', }, }); //@ //@ ### uniq([options,] [input, [output]]) //@ //@ Available options: //@ //@ + `-i`: Ignore case while comparing //@ + `-c`: Prefix lines by the number of occurrences //@ + `-d`: Only print duplicate lines, one for each group of identical lines //@ //@ Examples: //@ //@ ```javascript //@ uniq('foo.txt'); //@ uniq('-i', 'foo.txt'); //@ uniq('-cd', 'foo.txt', 'bar.txt'); //@ ``` //@ //@ Filter adjacent matching lines from `input`. function _uniq(options, input, output) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!pipe) { if (!input) common.error('no input given'); if (!fs.existsSync(input)) { common.error(input + ': No such file or directory'); } else if (common.statFollowLinks(input).isDirectory()) { common.error("error reading '" + input + "'"); } } if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) { common.error(output + ': Is a directory'); } var lines = (input ? fs.readFileSync(input, 'utf8') : pipe). trimRight(). split('\n'); var compare = function (a, b) { return options.ignoreCase ? a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) : a.localeCompare(b); }; var uniqed = lines.reduceRight(function (res, e) { // Perform uniq -c on the input if (res.length === 0) { return [{ count: 1, ln: e }]; } else if (compare(res[0].ln, e) === 0) { return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1)); } else { return [{ count: 1, ln: e }].concat(res); } }, []).filter(function (obj) { // Do we want only duplicated objects? return options.duplicates ? obj.count > 1 : true; }).map(function (obj) { // Are we tracking the counts of each line? return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln; }).join('\n') + '\n'; if (output) { (new common.ShellString(uniqed)).to(output); // if uniq writes to output, nothing is passed to the next command in the pipeline (if any) return ''; } else { return uniqed; } } module.exports = _uniq; node-shelljs-0.8.3/src/which.js000066400000000000000000000067651342005425100163520ustar00rootroot00000000000000var common = require('./common'); var fs = require('fs'); var path = require('path'); common.register('which', _which, { allowGlobbing: false, cmdOptions: { 'a': 'all', }, }); // XP's system default value for `PATHEXT` system variable, just in case it's not // set on Windows. var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; // For earlier versions of NodeJS that doesn't have a list of constants (< v6) var FILE_EXECUTABLE_MODE = 1; function isWindowsPlatform() { return process.platform === 'win32'; } // Cross-platform method for splitting environment `PATH` variables function splitPath(p) { return p ? p.split(path.delimiter) : []; } // Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason /* istanbul ignore next */ function isExecutable(pathName) { try { // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6 fs.accessSync(pathName, FILE_EXECUTABLE_MODE); } catch (err) { return false; } return true; } function checkPath(pathName) { return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory() && (isWindowsPlatform() || isExecutable(pathName)); } //@ //@ ### which(command) //@ //@ Examples: //@ //@ ```javascript //@ var nodeExec = which('node'); //@ ``` //@ //@ Searches for `command` in the system's `PATH`. On Windows, this uses the //@ `PATHEXT` variable to append the extension if it's not already executable. //@ Returns string containing the absolute path to `command`. function _which(options, cmd) { if (!cmd) common.error('must specify command'); var isWindows = isWindowsPlatform(); var pathArray = splitPath(process.env.PATH); var queryMatches = []; // No relative/absolute paths provided? if (cmd.indexOf('/') === -1) { // Assume that there are no extensions to append to queries (this is the // case for unix) var pathExtArray = ['']; if (isWindows) { // In case the PATHEXT variable is somehow not set (e.g. // child_process.spawn with an empty environment), use the XP default. var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; pathExtArray = splitPath(pathExtEnv.toUpperCase()); } // Search for command in PATH for (var k = 0; k < pathArray.length; k++) { // already found it if (queryMatches.length > 0 && !options.all) break; var attempt = path.resolve(pathArray[k], cmd); if (isWindows) { attempt = attempt.toUpperCase(); } var match = attempt.match(/\.[^<>:"/\|?*.]+$/); if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only // The user typed a query with the file extension, like // `which('node.exe')` if (checkPath(attempt)) { queryMatches.push(attempt); break; } } else { // All-platforms // Cycle through the PATHEXT array, and check each extension // Note: the array is always [''] on Unix for (var i = 0; i < pathExtArray.length; i++) { var ext = pathExtArray[i]; var newAttempt = attempt + ext; if (checkPath(newAttempt)) { queryMatches.push(newAttempt); break; } } } } } else if (checkPath(cmd)) { // a valid absolute or relative path queryMatches.push(path.resolve(cmd)); } if (queryMatches.length > 0) { return options.all ? queryMatches : queryMatches[0]; } return options.all ? [] : null; } module.exports = _which; node-shelljs-0.8.3/test/000077500000000000000000000000001342005425100150645ustar00rootroot00000000000000node-shelljs-0.8.3/test/.eslintrc.json000066400000000000000000000011551342005425100176620ustar00rootroot00000000000000{ "env": { "node": true }, "extends": "airbnb-base", "rules": { "import/no-mutable-exports": "off", "global-require": "off", "vars-on-top": "off", "spaced-comment": ["error", "always", { "markers": ["@", "@include"], "exceptions": ["@"] }], "no-param-reassign": "off", "no-console": "off", "curly": "off", "no-var": "error", "prefer-const": "error", "prefer-template": "off", "prefer-arrow-callback": "off", "no-underscore-dangle": "off", "max-len": "off", "new-cap": ["error", { "capIsNewExceptions": [ "ShellString" ]} ] } } node-shelljs-0.8.3/test/cat.js000066400000000000000000000064041342005425100161750ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; shell.config.silent = true; // // Invalids // test('no paths given', t => { const result = shell.cat(); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cat: no paths given'); }); test('nonexistent file', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.cat('/asdfasdf'); // file does not exist t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cat: no such file or directory: /asdfasdf'); }); test('directory', t => { const result = shell.cat('test/resources/cat'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cat: test/resources/cat: Is a directory'); }); // // Valids // test('simple', t => { const result = shell.cat('test/resources/cat/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test1\n'); }); test('multiple files', t => { const result = shell.cat('test/resources/cat/file2', 'test/resources/cat/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test2\ntest1\n'); }); test('multiple files, array syntax', t => { const result = shell.cat(['test/resources/cat/file2', 'test/resources/cat/file1']); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test2\ntest1\n'); }); test('glob', t => { const result = shell.cat('test/resources/file*.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.search('test1') > -1); // file order might be random t.truthy(result.search('test2') > -1); }); test('without EOF', t => { const result = shell.cat('test/resources/cat/file3'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test3'); }); test('empty', t => { const result = shell.cat('test/resources/cat/file5'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ''); }); // // With numbers // test('simple with numbers', t => { const result = shell.cat('-n', 'test/resources/cat/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ' 1\ttest1\n'); }); test('simple twelve lines file with numbers', t => { const result = shell.cat('-n', 'test/resources/cat/file4'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ' 1\ttest4-01\n 2\ttest4-02\n 3\ttest4-03\n 4\ttest4-04\n 5\ttest4-05\n 6\ttest4-06\n 7\ttest4-07\n 8\ttest4-08\n 9\ttest4-09\n 10\ttest4-10\n 11\ttest4-11\n 12\ttest4-12\n'); }); test('multiple with numbers', t => { const result = shell.cat('-n', 'test/resources/cat/file2', 'test/resources/cat/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ' 1\ttest2\n 2\ttest1\n'); }); test('simple numbers without EOF', t => { const result = shell.cat('-n', 'test/resources/cat/file3'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ' 1\ttest3'); }); test('multiple numbers without EOF', t => { const result = shell.cat('-n', 'test/resources/cat/file3', 'test/resources/cat/file2', 'test/resources/cat/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), ' 1\ttest3test2\n 2\ttest1\n'); }); node-shelljs-0.8.3/test/cd.js000066400000000000000000000050751342005425100160170ustar00rootroot00000000000000import fs from 'fs'; import os from 'os'; import path from 'path'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; const cur = shell.pwd().toString(); test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); process.chdir(cur); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { process.chdir(cur); shell.rm('-rf', t.context.tmp); }); // // Invalids // test('nonexistent directory', t => { t.falsy(fs.existsSync('/asdfasdf')); const result = shell.cd('/asdfasdf'); // dir does not exist t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cd: no such file or directory: /asdfasdf'); }); test('file not dir', t => { t.truthy(fs.existsSync('test/resources/file1')); // sanity check const result = shell.cd('test/resources/file1'); // file, not dir t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cd: not a directory: test/resources/file1'); }); test('no previous dir', t => { const result = shell.cd('-'); // Haven't changed yet, so there is no previous directory t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cd: could not find previous directory'); }); // // Valids // test('relative path', t => { const result = shell.cd(t.context.tmp); t.falsy(shell.error()); t.is(result.code, 0); t.is(path.basename(process.cwd()), t.context.tmp); }); test('absolute path', t => { const result = shell.cd('/'); t.falsy(shell.error()); t.is(result.code, 0); t.is(process.cwd(), path.resolve('/')); }); test('previous directory (-)', t => { shell.cd('/'); const result = shell.cd('-'); t.falsy(shell.error()); t.is(result.code, 0); t.is(process.cwd(), path.resolve(cur.toString())); }); test('cd + other commands', t => { t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); let result = shell.cd('test/resources'); t.falsy(shell.error()); t.is(result.code, 0); result = shell.cp('file1', `../../${t.context.tmp}`); t.falsy(shell.error()); t.is(result.code, 0); result = shell.cd(`../../${t.context.tmp}`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync('file1')); }); test('Tilde expansion', t => { shell.cd('~'); t.is(process.cwd(), os.homedir()); shell.cd('..'); t.not(process.cwd(), os.homedir()); shell.cd('~'); // Change back to home t.is(process.cwd(), os.homedir()); }); test('Goes to home directory if no arguments are passed', t => { const result = shell.cd(); t.falsy(shell.error()); t.is(result.code, 0); t.is(process.cwd(), os.homedir()); }); node-shelljs-0.8.3/test/chmod.js000066400000000000000000000237471342005425100165310ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; let TMP; const BITMASK = parseInt('777', 8); test.before(() => { TMP = utils.getTempDir(); shell.cp('-r', 'test/resources', TMP); shell.config.silent = true; }); test.after(() => { shell.rm('-rf', TMP); }); // // Invalids // test('invalid permissions', t => { let result = shell.chmod('blah'); t.truthy(shell.error()); t.is(result.code, 1); result = shell.chmod('893', `${TMP}/chmod`); // invalid permissions - mode must be in octal t.truthy(shell.error()); t.is(result.code, 1); }); test('Basic usage with octal codes', t => { utils.skipOnWin(t, () => { let result = shell.chmod('755', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('755', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('644', 8) ); }); }); test('symbolic mode', t => { utils.skipOnWin(t, () => { let result = shell.chmod('o+x', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('007', 8), parseInt('005', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('symbolic mode, without group', t => { utils.skipOnWin(t, () => { let result = shell.chmod('+x', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('755', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('Test setuid', t => { utils.skipOnWin(t, () => { let result = shell.chmod('u+s', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('4000', 8), parseInt('4000', 8) ); result = shell.chmod('u-s', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('644', 8) ); // according to POSIX standards at http://linux.die.net/man/1/chmod, // setuid is never cleared from a directory unless explicitly asked for. result = shell.chmod('u+s', `${TMP}/chmod/c`); t.is(result.code, 0); result = shell.chmod('755', `${TMP}/chmod/c`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/c`).mode & parseInt('4000', 8), parseInt('4000', 8) ); result = shell.chmod('u-s', `${TMP}/chmod/c`); t.is(result.code, 0); }); }); test('Test setgid', t => { utils.skipOnWin(t, () => { let result = shell.chmod('g+s', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('2000', 8), parseInt('2000', 8) ); result = shell.chmod('g-s', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('644', 8) ); }); }); test('Test sticky bit', t => { utils.skipOnWin(t, () => { let result = shell.chmod('+t', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('1000', 8), parseInt('1000', 8) ); result = shell.chmod('-t', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & BITMASK, parseInt('644', 8) ); t.is(common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('1000', 8), 0); }); }); test('Test directories', t => { utils.skipOnWin(t, () => { let result = shell.chmod('a-w', `${TMP}/chmod/b/a/b`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/b/a/b`).mode & BITMASK, parseInt('555', 8) ); result = shell.chmod('755', `${TMP}/chmod/b/a/b`); t.is(result.code, 0); }); }); test('Test recursion', t => { utils.skipOnWin(t, () => { let result = shell.chmod('-R', 'a+w', `${TMP}/chmod/b`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/b/a/b`).mode & BITMASK, BITMASK ); result = shell.chmod('-R', '755', `${TMP}/chmod/b`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/b/a/b`).mode & BITMASK, parseInt('755', 8) ); }); }); test('Test symbolic links w/ recursion - WARNING: *nix only', t => { utils.skipOnWin(t, () => { fs.symlinkSync(`${TMP}/chmod/b/a`, `${TMP}/chmod/a/b/c/link`, 'dir'); let result = shell.chmod('-R', 'u-w', `${TMP}/chmod/a/b`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/a/b/c`).mode & parseInt('700', 8), parseInt('500', 8) ); t.is( common.statFollowLinks(`${TMP}/chmod/b/a`).mode & parseInt('700', 8), parseInt('700', 8) ); result = shell.chmod('-R', 'u+w', `${TMP}/chmod/a/b`); t.is(result.code, 0); fs.unlinkSync(`${TMP}/chmod/a/b/c/link`); }); }); test('Test combinations', t => { let result = shell.chmod('a-rwx', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('000', 8), parseInt('000', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('multiple symbolic modes', t => { let result = shell.chmod('a-rwx,u+r', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('400', 8), parseInt('400', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('multiple symbolic modes #2', t => { let result = shell.chmod('a-rwx,u+rw', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('600', 8), parseInt('600', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('multiple symbolic modes #3', t => { utils.skipOnWin(t, () => { let result = shell.chmod('a-rwx,u+rwx', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('700', 8), parseInt('700', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('u+rw', t => { let result = shell.chmod('000', `${TMP}/chmod/file1`); t.is(result.code, 0); result = shell.chmod('u+rw', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('600', 8), parseInt('600', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('u+wx', t => { utils.skipOnWin(t, () => { let result = shell.chmod('000', `${TMP}/chmod/file1`); t.is(result.code, 0); result = shell.chmod('u+wx', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('300', 8), parseInt('300', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('Multiple symbolic modes at once', t => { utils.skipOnWin(t, () => { let result = shell.chmod('000', `${TMP}/chmod/file1`); t.is(result.code, 0); result = shell.chmod('u+r,g+w,o+x', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('421', 8), parseInt('421', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('u+rw,g+wx', t => { utils.skipOnWin(t, () => { let result = shell.chmod('000', `${TMP}/chmod/file1`); t.is(result.code, 0); result = shell.chmod('u+rw,g+wx', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('630', 8), parseInt('630', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); }); test('u-x,g+rw', t => { let result = shell.chmod('700', `${TMP}/chmod/file1`); t.is(result.code, 0); result = shell.chmod('u-x,g+rw', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('660', 8), parseInt('660', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('a-rwx,u+rw', t => { let result = shell.chmod('a-rwx,u+rw', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('600', 8), parseInt('600', 8) ); result = shell.chmod('a-rwx,u+rw', `${TMP}/chmod/file1`); t.is(result.code, 0); t.is( common.statFollowLinks(`${TMP}/chmod/file1`).mode & parseInt('600', 8), parseInt('600', 8) ); result = shell.chmod('644', `${TMP}/chmod/file1`); t.is(result.code, 0); }); test('Numeric modes', t => { let result = shell.chmod('744', `${TMP}/chmod/xdir`); t.is(result.code, 0); result = shell.chmod('644', `${TMP}/chmod/xdir/file`); t.is(result.code, 0); result = shell.chmod('744', `${TMP}/chmod/xdir/deep`); t.is(result.code, 0); result = shell.chmod('644', `${TMP}/chmod/xdir/deep/file`); t.is(result.code, 0); result = shell.chmod('-R', 'a+X', `${TMP}/chmod/xdir`); t.is(result.code, 0); }); test('Make sure chmod succeeds for a variety of octal codes', t => { utils.skipOnWin(t, () => { t.is( common.statFollowLinks(`${TMP}/chmod/xdir`).mode & parseInt('755', 8), parseInt('755', 8) ); t.is( common.statFollowLinks(`${TMP}/chmod/xdir/file`).mode & parseInt('644', 8), parseInt('644', 8) ); t.is( common.statFollowLinks(`${TMP}/chmod/xdir/deep`).mode & parseInt('755', 8), parseInt('755', 8) ); t.is( common.statFollowLinks(`${TMP}/chmod/xdir/deep/file`).mode & parseInt('644', 8), parseInt('644', 8) ); }); }); node-shelljs-0.8.3/test/common.js000066400000000000000000000163531342005425100167220ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; shell.config.silent = true; test.beforeEach(() => { common.state.error = null; common.state.errorCode = 0; }); // // Invalids // test('too few args', t => { t.throws(() => { common.expand(); }, TypeError); }); test('should be a list', t => { t.throws(() => { common.expand('test/resources'); }, TypeError); }); test('parseOptions (invalid option in options object)', t => { t.throws(() => { common.parseOptions({ q: 'some string value' }, { R: 'recursive', f: 'force', r: 'reverse', }); }); }); test('parseOptions (without a hyphen in the string)', t => { t.throws(() => { common.parseOptions('f', { f: 'force', }); }); }); test('parseOptions (opt is not a string/object)', t => { t.throws(() => { common.parseOptions(1, { f: 'force', }); }); }); test('parseOptions (map is not an object)', t => { t.throws(() => { common.parseOptions('-f', 27); }); }); test('parseOptions (errorOptions is not an object)', t => { t.throws(() => { common.parseOptions('-f', { f: 'force', }, 'not a valid errorOptions'); }); }); test('parseOptions (unrecognized string option)', t => { t.throws(() => { common.parseOptions('-z', { f: 'force', }); }); }); test('parseOptions (unrecognized option in Object)', t => { t.throws(() => { common.parseOptions({ '-c': 7 }, { f: 'force', }); }); }); test('parseOptions (invalid type)', t => { t.throws(() => { common.parseOptions(12, { R: 'recursive', f: 'force', r: 'reverse', }); }); }); test('convertErrorOutput: no args', t => { t.throws(() => { common.convertErrorOutput(); }, TypeError); }); test('convertErrorOutput: input must be a vanilla string', t => { t.throws(() => { common.convertErrorOutput(3); }, TypeError); t.throws(() => { common.convertErrorOutput({}); }, TypeError); }); // // Valids // // // common.convertErrorOutput() // test('convertErrorOutput: nothing to convert', t => { const input = 'hello world'; const result = common.convertErrorOutput(input); t.is(result, input); }); test('convertErrorOutput: does not change forward slash', t => { const input = 'dir/sub/file.txt'; const result = common.convertErrorOutput(input); t.is(result, input); }); test('convertErrorOutput: changes backslashes to forward slashes', t => { const input = 'dir\\sub\\file.txt'; const result = common.convertErrorOutput(input); t.is(result, 'dir/sub/file.txt'); }); // // common.expand() // test('single file, array syntax', t => { const result = common.expand(['test/resources/file1.txt']); t.deepEqual(result, ['test/resources/file1.txt']); }); test('multiple file, glob syntax, * for file name', t => { const result = common.expand(['test/resources/file*.txt']); t.deepEqual(result.sort(), ['test/resources/file1.txt', 'test/resources/file2.txt'].sort()); }); test('multiple file, glob syntax, * for directory name', t => { const result = common.expand(['test/r*/file*.txt']); t.deepEqual(result.sort(), ['test/resources/file1.txt', 'test/resources/file2.txt'].sort()); }); test('multiple file, glob syntax, ** for directory name', t => { const result = common.expand(['test/resources/**/file*.js']); t.deepEqual( result.sort(), ['test/resources/file1.js', 'test/resources/file2.js', 'test/resources/ls/file1.js', 'test/resources/ls/file2.js'].sort() ); }); test('broken links still expand', t => { const result = common.expand(['test/resources/b*dlink']); t.deepEqual(result, ['test/resources/badlink']); }); test('empty array', t => { const result = common.expand([]); t.deepEqual(result, []); }); test('empty string', t => { const result = common.expand(['']); t.deepEqual(result, ['']); }); test('non-string', t => { const result = common.expand([5]); t.deepEqual(result, [5]); }); // // common.buffer() // test('common.buffer returns buffer', t => { const buf = common.buffer(); t.truthy(buf instanceof Buffer); t.is(buf.length, 64 * 1024); }); test('common.buffer with explicit length', t => { const buf = common.buffer(20); t.truthy(buf instanceof Buffer); t.is(buf.length, 20); }); test('common.buffer with different config.bufLength', t => { common.config.bufLength = 20; const buf = common.buffer(); t.truthy(buf instanceof Buffer); t.is(buf.length, 20); common.config.reset(); }); test('common.parseOptions (normal case)', t => { const result = common.parseOptions('-Rf', { R: 'recursive', f: 'force', r: 'reverse', }); t.truthy(result.recursive); t.truthy(result.force); t.falsy(result.reverse); }); test('common.parseOptions (with mutually-negating options)', t => { const result = common.parseOptions('-f', { n: 'no_force', f: '!no_force', R: 'recursive', }); t.falsy(result.recursive); t.falsy(result.no_force); t.is(result.force, undefined); // this key shouldn't exist }); test( 'common.parseOptions (the last of the conflicting options should hold)', t => { const options = { n: 'no_force', f: '!no_force', R: 'recursive', }; let result = common.parseOptions('-fn', options); t.false(result.recursive); t.truthy(result.no_force); t.is(result.force, undefined); // this key shouldn't exist result = common.parseOptions('-nf', options); t.false(result.recursive); t.false(result.no_force); t.is(result.force, undefined); // this key shouldn't exist } ); test('common.parseOptions using an object to hold options', t => { const result = common.parseOptions({ '-v': 'some text here' }, { v: 'value', f: 'force', r: 'reverse', }); t.is(result.value, 'some text here'); t.false(result.force); t.false(result.reverse); }); test('common.parseOptions throws when passed a string not starting with "-"', t => { t.throws(() => { common.parseOptions('a', { '-a': 'throws' }); }, Error, "Options string must start with a '-'"); }); test('common.parseOptions with -- argument', t => { const result = common.parseOptions('--', { R: 'recursive', f: 'force', r: 'reverse', }); t.falsy(result.recursive); t.falsy(result.force); t.falsy(result.reverse); }); test('Some basic tests on the ShellString type', t => { const result = shell.ShellString('foo'); t.is(result.toString(), 'foo'); t.is(result.stdout, 'foo'); t.is(result.stderr, undefined); t.truthy(result.to); t.truthy(result.toEnd); }); test.cb('Commands that fail will still output error messages to stderr', t => { const script = 'require(\'./global\'); ls(\'noexist\'); cd(\'noexist\');'; utils.runScript(script, (err, stdout, stderr) => { t.is(stdout, ''); t.is( stderr, 'ls: no such file or directory: noexist\ncd: no such file or directory: noexist\n' ); t.end(); }); }); test('execPath value makes sense', t => { // TODO(nate): change this test if we add electron support in the unit tests t.is(shell.config.execPath, process.execPath); t.is(typeof shell.config.execPath, 'string'); }); test('Changing shell.config.execPath does not modify process', t => { shell.config.execPath = 'foo'; t.not(shell.config.execPath, process.execPath); }); node-shelljs-0.8.3/test/config.js000066400000000000000000000037501342005425100166740ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; // // Valids // // // config.silent // test('config.silent is false by default', t => { t.falsy(shell.config.silent); }); test('config.silent can be set to true', t => { shell.config.silent = true; t.truthy(shell.config.silent); }); test('config.silent can be set to false', t => { shell.config.silent = false; t.falsy(shell.config.silent); }); // // config.fatal // test.cb('config.fatal = false', t => { t.falsy(shell.config.fatal); const script = 'require(\'./global.js\'); config.silent=true; config.fatal=false; cp("this_file_doesnt_exist", "."); echo("got here");'; utils.runScript(script, (err, stdout) => { t.truthy(stdout.match('got here')); t.end(); }); }); test.cb('config.fatal = true', t => { const script = 'require(\'./global.js\'); config.silent=true; config.fatal=true; cp("this_file_doesnt_exist", "."); echo("got here");'; utils.runScript(script, (err, stdout) => { t.falsy(stdout.match('got here')); t.end(); }); }); // // config.globOptions // test('Expands to directories by default', t => { const result = common.expand(['test/resources/*a*']); t.is(result.length, 5); t.truthy(result.indexOf('test/resources/a.txt') > -1); t.truthy(result.indexOf('test/resources/badlink') > -1); t.truthy(result.indexOf('test/resources/cat') > -1); t.truthy(result.indexOf('test/resources/head') > -1); t.truthy(result.indexOf('test/resources/external') > -1); }); test( 'Check to make sure options get passed through (nodir is an example)', t => { shell.config.globOptions = { nodir: true }; const result = common.expand(['test/resources/*a*']); t.is(result.length, 2); t.truthy(result.indexOf('test/resources/a.txt') > -1); t.truthy(result.indexOf('test/resources/badlink') > -1); t.truthy(result.indexOf('test/resources/cat') < 0); t.truthy(result.indexOf('test/resources/external') < 0); } ); node-shelljs-0.8.3/test/cp.js000066400000000000000000000716351342005425100160400ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; const oldMaxDepth = shell.config.maxdepth; const CWD = process.cwd(); test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { process.chdir(CWD); shell.rm('-rf', t.context.tmp); shell.config.maxdepth = oldMaxDepth; }); // // Invalids // test('no args', t => { const result = shell.cp(); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cp: missing and/or '); }); test('no destination', t => { const result = shell.cp('file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cp: missing and/or '); }); test('only an option', t => { const result = shell.cp('-f'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cp: missing and/or '); }); test('invalid option', t => { const result = shell.cp('-@', 'test/resources/file1', `${t.context.tmp}/file1`); t.truthy(shell.error()); t.is(result.code, 1); t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); t.is(result.stderr, 'cp: option not recognized: @'); }); test('invalid option #2', t => { const result = shell.cp('-Z', 'asdfasdf', `${t.context.tmp}/file2`); t.truthy(shell.error()); t.is(result.code, 1); t.falsy(fs.existsSync(`${t.context.tmp}/file2`)); t.is(result.stderr, 'cp: option not recognized: Z'); }); test('source does not exist', t => { const result = shell.cp('asdfasdf', t.context.tmp); t.truthy(shell.error()); t.is(result.code, 1); t.is(utils.numLines(result.stderr), 1); t.falsy(fs.existsSync(`${t.context.tmp}/asdfasdf`)); t.is(result.stderr, 'cp: no such file or directory: asdfasdf'); }); test('multiple sources do not exist', t => { const result = shell.cp('asdfasdf1', 'asdfasdf2', t.context.tmp); t.truthy(shell.error()); t.is(result.code, 1); t.is(utils.numLines(result.stderr), 2); t.falsy(fs.existsSync(`${t.context.tmp}/asdfasdf1`)); t.falsy(fs.existsSync(`${t.context.tmp}/asdfasdf2`)); t.is( result.stderr, 'cp: no such file or directory: asdfasdf1\ncp: no such file or directory: asdfasdf2' ); }); test('too many sources', t => { const result = shell.cp('asdfasdf1', 'asdfasdf2', 'test/resources/file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'cp: dest is not a directory (too many sources)'); }); test('too many sources #2', t => { const result = shell.cp('test/resources/file1', 'test/resources/file2', `${t.context.tmp}/a_file`); t.truthy(shell.error()); t.is(result.code, 1); t.falsy(fs.existsSync(`${t.context.tmp}/a_file`)); t.is(result.stderr, 'cp: dest is not a directory (too many sources)'); }); test('empty string source', t => { const result = shell.cp('', 'dest'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "cp: no such file or directory: ''"); }); // // Valids // test('dest already exists', t => { const oldContents = shell.cat('test/resources/file2').toString(); const result = shell.cp('-n', 'test/resources/file1', 'test/resources/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stderr, ''); t.is(shell.cat('test/resources/file2').toString(), oldContents); }); test('-nR does not overwrite an existing file at the destination', t => { // Create tmp/new/cp/a const dest = `${t.context.tmp}/new/cp`; shell.mkdir('-p', dest); const oldContents = 'original content'; shell.ShellString(oldContents).to(`${dest}/a`); // Attempt to overwrite /tmp/new/cp/ with test/resources/cp/ const result = shell.cp('-nR', 'test/resources/cp/', `${t.context.tmp}/new/`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(result.stderr); t.is(shell.cat(`${dest}/a`).toString(), oldContents); }); test('-n does not overwrite an existing file if the destination is a directory', t => { const oldContents = 'original content'; shell.cp('test/resources/file1', `${t.context.tmp}`); new shell.ShellString(oldContents).to(`${t.context.tmp}/file1`); const result = shell.cp('-n', 'test/resources/file1', `${t.context.tmp}`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(result.stderr); t.is(shell.cat(`${t.context.tmp}/file1`).toString(), oldContents); }); test('-f by default', t => { shell.cp('test/resources/file2', 'test/resources/copyfile2'); const result = shell.cp('test/resources/file1', 'test/resources/file2'); // dest already exists t.falsy(shell.error()); t.is(result.code, 0); t.falsy(result.stderr); t.is(shell.cat('test/resources/file1').toString(), shell.cat('test/resources/file2').toString()); // after cp shell.mv('test/resources/copyfile2', 'test/resources/file2'); // restore t.falsy(shell.error()); }); test('-f (explicitly)', t => { shell.cp('test/resources/file2', 'test/resources/copyfile2'); const result = shell.cp('-f', 'test/resources/file1', 'test/resources/file2'); // dest already exists t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.cat('test/resources/file1').toString(), shell.cat('test/resources/file2').toString()); // after cp shell.mv('test/resources/copyfile2', 'test/resources/file2'); // restore t.falsy(shell.error()); t.is(result.code, 0); }); test('simple - to dir', t => { const result = shell.cp('test/resources/file1', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); }); test('simple - to file', t => { const result = shell.cp('test/resources/file2', `${t.context.tmp}/file2`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); }); test('simple - file list', t => { const result = shell.cp('test/resources/file1', 'test/resources/file2', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); }); test('simple - file list, array syntax', t => { const result = shell.cp(['test/resources/file1', 'test/resources/file2'], t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); }); test('-f option', t => { shell.cp('test/resources/file2', `${t.context.tmp}/file3`); t.truthy(fs.existsSync(`${t.context.tmp}/file3`)); const result = shell.cp('-f', 'test/resources/file2', `${t.context.tmp}/file3`); // file exists, but -f specified t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file3`)); }); test('glob', t => { const result = shell.cp('test/resources/file?', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); t.falsy(fs.existsSync(`${t.context.tmp}/file1.js`)); t.falsy(fs.existsSync(`${t.context.tmp}/file2.js`)); t.falsy(fs.existsSync(`${t.context.tmp}/file1.txt`)); t.falsy(fs.existsSync(`${t.context.tmp}/file2.txt`)); }); test('wildcard', t => { shell.rm(`${t.context.tmp}/file1`, `${t.context.tmp}/file2`); const result = shell.cp('test/resources/file*', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); t.truthy(fs.existsSync(`${t.context.tmp}/file1.js`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2.js`)); t.truthy(fs.existsSync(`${t.context.tmp}/file1.txt`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2.txt`)); }); test('recursive, with regular files', t => { const result = shell.cp('-R', 'test/resources/file1', 'test/resources/file2', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2`)); }); test('omit directory if missing recursive flag', t => { const result = shell.cp('test/resources/cp', t.context.tmp); t.is(shell.error(), "cp: omitting directory 'test/resources/cp'"); t.is(result.stderr, "cp: omitting directory 'test/resources/cp'"); t.is(result.code, 1); t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); t.falsy(fs.existsSync(`${t.context.tmp}/file2`)); }); test('recursive, nothing exists', t => { const result = shell.cp('-R', 'test/resources/cp', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.ls('-R', 'test/resources/cp').toString(), shell.ls('-R', `${t.context.tmp}/cp`).toString()); }); test('recursive, nothing exists, source ends in "/"', t => { // Github issue #15 const result = shell.cp('-R', 'test/resources/cp/', `${t.context.tmp}/`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.ls('-R', 'test/resources/cp').toString(), shell.ls('-R', `${t.context.tmp}/cp`).toString()); }); test('recursive, globbing regular files with extension', t => { // Github issue #376 const result = shell.cp('-R', 'test/resources/file*.txt', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1.txt`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2.txt`)); }); test('recursive, copying one regular file', t => { // Github issue #376 const result = shell.cp('-R', 'test/resources/file1.txt', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file1.txt`)); t.falsy(common.statFollowLinks(`${t.context.tmp}/file1.txt`).isDirectory()); // don't let it be a dir } ); test('recursive, everything exists, no force flag', t => { const result = shell.cp('-R', 'test/resources/cp', t.context.tmp); t.falsy(shell.error()); // crash test only t.falsy(result.stderr); t.is(result.code, 0); }); test('-R implies to not follow links', t => { utils.skipOnWin(t, () => { shell.cp('-R', 'test/resources/cp/*', t.context.tmp); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/links/sym.lnk`).isSymbolicLink()); // this one is a link t.falsy((common.statNoFollowLinks(`${t.context.tmp}/fakeLinks/sym.lnk`).isSymbolicLink())); // this one isn't t.not( shell.cat(`${t.context.tmp}/links/sym.lnk`).toString(), shell.cat(`${t.context.tmp}/fakeLinks/sym.lnk`).toString() ); const result = shell.cp('-R', `${t.context.tmp}/links/*`, `${t.context.tmp}/fakeLinks`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/links/sym.lnk`).isSymbolicLink()); // this one is a link t.truthy(common.statNoFollowLinks(`${t.context.tmp}/fakeLinks/sym.lnk`).isSymbolicLink()); // this one is now a link t.is( shell.cat(`${t.context.tmp}/links/sym.lnk`).toString(), shell.cat(`${t.context.tmp}/fakeLinks/sym.lnk`).toString() ); }); }); test('Missing -R implies -L', t => { utils.skipOnWin(t, () => { // Recursive, everything exists, overwrite a real file *by following a link* // Because missing the -R implies -L. shell.cp('-R', 'test/resources/cp/*', t.context.tmp); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/links/sym.lnk`).isSymbolicLink()); // this one is a link t.falsy((common.statNoFollowLinks(`${t.context.tmp}/fakeLinks/sym.lnk`).isSymbolicLink())); // this one isn't t.not( shell.cat(`${t.context.tmp}/links/sym.lnk`).toString(), shell.cat(`${t.context.tmp}/fakeLinks/sym.lnk`).toString() ); const result = shell.cp(`${t.context.tmp}/links/*`, `${t.context.tmp}/fakeLinks`); // don't use -R t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/links/sym.lnk`).isSymbolicLink()); // this one is a link t.falsy(common.statNoFollowLinks(`${t.context.tmp}/fakeLinks/sym.lnk`).isSymbolicLink()); // this one is still not a link // But it still follows the link t.is( shell.cat(`${t.context.tmp}/links/sym.lnk`).toString(), shell.cat(`${t.context.tmp}/fakeLinks/sym.lnk`).toString() ); }); }); test('recursive, everything exists, with force flag', t => { let result = shell.cp('-R', 'test/resources/cp', t.context.tmp); shell.ShellString('changing things around').to(`${t.context.tmp}/cp/dir_a/z`); t.not(shell.cat('test/resources/cp/dir_a/z').toString(), shell.cat(`${t.context.tmp}/cp/dir_a/z`).toString()); // before cp result = shell.cp('-Rf', 'test/resources/cp', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.cat('test/resources/cp/dir_a/z').toString(), shell.cat(`${t.context.tmp}/cp/dir_a/z`).toString()); // after cp }); test("recursive, creates dest dir since it's only one level deep", t => { // Github issue #44 const result = shell.cp('-r', 'test/resources/issue44', `${t.context.tmp}/dir2`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.ls('-R', 'test/resources/issue44').toString(), shell.ls('-R', `${t.context.tmp}/dir2`).toString()); t.is( shell.cat('test/resources/issue44/main.js').toString(), shell.cat(`${t.context.tmp}/dir2/main.js`).toString() ); }); test("recursive, does *not* create dest dir since it's too deep", t => { // Github issue #44 const result = shell.cp('-r', 'test/resources/issue44', `${t.context.tmp}/dir2/dir3`); t.truthy(shell.error()); t.is( result.stderr, `cp: cannot create directory '${t.context.tmp}/dir2/dir3': No such file or directory` ); t.is(result.code, 1); t.falsy(fs.existsSync(`${t.context.tmp}/dir2`)); }); test('recursive, copies entire directory', t => { const result = shell.cp('-r', 'test/resources/cp/dir_a', `${t.context.tmp}/dest`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/dest/z`)); }); test('recursive, with trailing slash, does the exact same', t => { const result = shell.cp('-r', 'test/resources/cp/dir_a/', `${t.context.tmp}/dest`); t.is(result.code, 0); t.falsy(shell.error()); t.truthy(fs.existsSync(`${t.context.tmp}/dest/z`)); }); test('preserve mode bits by default for file', t => { utils.skipOnWin(t, () => { const execBit = parseInt('001', 8); t.is(common.statFollowLinks('test/resources/cp-mode-bits/executable').mode & execBit, execBit); shell.cp('test/resources/cp-mode-bits/executable', `${t.context.tmp}/executable`); t.is( common.statFollowLinks('test/resources/cp-mode-bits/executable').mode, common.statFollowLinks(`${t.context.tmp}/executable`).mode ); }); }); test('Make sure hidden files are copied recursively', t => { shell.rm('-rf', t.context.tmp); const result = shell.cp('-r', 'test/resources/ls/', t.context.tmp); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/.hidden_file`)); }); test('no-recursive will copy regular files only', t => { const result = shell.cp('test/resources/file1.txt', 'test/resources/ls/', t.context.tmp); t.is(result.code, 1); t.truthy(shell.error()); t.falsy(fs.existsSync(`${t.context.tmp}/.hidden_file`)); // doesn't copy dir contents t.falsy(fs.existsSync(`${t.context.tmp}/ls`)); // doesn't copy dir itself t.truthy(fs.existsSync(`${t.context.tmp}/file1.txt`)); }); test('no-recursive will copy regular files only', t => { const result = shell.cp('test/resources/file1.txt', 'test/resources/file2.txt', 'test/resources/cp', 'test/resources/ls/', t.context.tmp); t.is(result.code, 1); t.truthy(shell.error()); t.falsy(fs.existsSync(`${t.context.tmp}/.hidden_file`)); // doesn't copy dir contents t.falsy(fs.existsSync(`${t.context.tmp}/ls`)); // doesn't copy dir itself t.falsy(fs.existsSync(`${t.context.tmp}/a`)); // doesn't copy dir contents t.falsy(fs.existsSync(`${t.context.tmp}/cp`)); // doesn't copy dir itself t.truthy(fs.existsSync(`${t.context.tmp}/file1.txt`)); t.truthy(fs.existsSync(`${t.context.tmp}/file2.txt`)); }); test('-R implies -P', t => { utils.skipOnWin(t, () => { shell.cp('-R', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); }); test('using -P explicitly works', t => { utils.skipOnWin(t, () => { shell.cp('-P', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); }); test('using -PR on a link to a folder does not follow the link', t => { utils.skipOnWin(t, () => { shell.cp('-PR', 'test/resources/cp/symFolder', t.context.tmp); t.truthy(common.statNoFollowLinks(`${t.context.tmp}/symFolder`).isSymbolicLink()); }); }); test('-L overrides -P for copying directory', t => { utils.skipOnWin(t, () => { shell.cp('-LPR', 'test/resources/cp/symFolder', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/symFolder`).isSymbolicLink()); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/symFolder/sym.lnk`).isSymbolicLink()); }); }); test('Recursive, copies entire directory with no symlinks and -L option does not cause change in behavior', t => { utils.skipOnWin(t, () => { const result = shell.cp('-rL', 'test/resources/cp/dir_a', `${t.context.tmp}/dest`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/dest/z`)); }); }); test('-u flag won\'t overwrite newer files', t => { shell.touch(`${t.context.tmp}/file1.js`); shell.cp('-u', 'test/resources/file1.js', t.context.tmp); t.falsy(shell.error()); t.not(shell.cat('test/resources/file1.js').toString(), shell.cat(`${t.context.tmp}/file1.js`).toString()); }); test('-u flag does overwrite older files', t => { shell.touch({ '-d': new Date(10) }, `${t.context.tmp}/file1.js`); // really old file shell.cp('-u', 'test/resources/file1.js', t.context.tmp); t.falsy(shell.error()); t.is(shell.cat('test/resources/file1.js').toString(), shell.cat(`${t.context.tmp}/file1.js`).toString()); }); test('-u flag works even if it\'s not overwriting a file', t => { t.falsy(fs.existsSync(`${t.context.tmp}/file1.js`)); shell.cp('-u', 'test/resources/file1.js', t.context.tmp); t.falsy(shell.error()); t.is(shell.cat('test/resources/file1.js').toString(), shell.cat(`${t.context.tmp}/file1.js`).toString()); }); test('-u flag works correctly recursively', t => { shell.mkdir(`${t.context.tmp}/foo`); [1, 2, 3].forEach(num => { new shell.ShellString('old\n').to(`${t.context.tmp}/foo/file${num}`); shell.touch({ '-d': new Date(10) }, `${t.context.tmp}/foo/file${num}`); }); shell.mkdir(`${t.context.tmp}/bar`); [1, 2, 3].forEach(num => { new shell.ShellString('new\n').to(`${t.context.tmp}/bar/file${num}`); shell.touch({ '-d': new Date(1000) }, `${t.context.tmp}/bar/file${num}`); }); // put one new one in the foo directory new shell.ShellString('newest\n').to(`${t.context.tmp}/foo/file3`); shell.touch({ '-d': new Date(10000) }, `${t.context.tmp}/foo/file3`); shell.cp('-u', `${t.context.tmp}/foo/*`, `${t.context.tmp}/bar`); t.falsy(shell.error()); t.is(shell.cat(`${t.context.tmp}/bar/*`).toString(), 'new\nnew\nnewest\n'); }); test('using -R on a link to a folder *does* follow the link', t => { shell.cp('-R', 'test/resources/cp/symFolder', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/symFolder`).isSymbolicLink()); }); test('Without -R, -L is implied', t => { shell.cp('test/resources/cp/links/sym.lnk', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); test('-L explicitly works', t => { shell.cp('-L', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); test('using -LR does not imply -P', t => { shell.cp('-LR', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); test('using -LR also works recursively on directories containing links', t => { shell.cp('-LR', 'test/resources/cp/links', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/links/sym.lnk`).isSymbolicLink()); }); test('-L always overrides a -P', t => { shell.cp('-LP', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); shell.cp('-LPR', 'test/resources/cp/links/sym.lnk', t.context.tmp); t.falsy(common.statNoFollowLinks(`${t.context.tmp}/sym.lnk`).isSymbolicLink()); }); test('Make sure max depth does not limit shallow directory structures', t => { shell.config.maxdepth = 3; const TMP = t.context.tmp; shell.mkdir(`${TMP}/foo`); for (let k = 0; k < 5; k++) { shell.mkdir(`${TMP}/foo/dir${k}`); } shell.cp('-r', `${TMP}/foo`, `${TMP}/bar`); t.is(shell.ls(`${TMP}/foo`).stdout, shell.ls(`${TMP}/bar`).stdout); }); test('Test max depth.', t => { shell.config.maxdepth = 32; let directory = ''; for (let i = 1; i < 40; i++) { directory += '/' + i; } let directory32deep = ''; for (let i = 1; i < 32; i++) { directory32deep += '/' + i; } shell.mkdir('-p', `${t.context.tmp}/0${directory}`); shell.cp('-r', `${t.context.tmp}/0`, `${t.context.tmp}/copytestdepth`); // Check full directory exists. t.truthy(shell.test('-d', `${t.context.tmp}/0/${directory}`)); // Check full copy of directory does not exist. t.falsy(shell.test('-d', `${t.context.tmp}/copytestdepth${directory}`)); // Check last directory to exist is below maxdepth. t.truthy(shell.test('-d', `${t.context.tmp}/copytestdepth${directory32deep}`)); t.falsy(shell.test('-d', `${t.context.tmp}/copytestdepth${directory32deep}/32`)); utils.skipOnWinForEPERM(shell.ln.bind(shell, '-s', `${t.context.tmp}/0`, `${t.context.tmp}/symlinktest`), () => { if (!shell.test('-L', `${t.context.tmp}/symlinktest`)) { t.fail(); } // Create symlinks to check for cycle. shell.cd(`${t.context.tmp}/0/1/2/3/4`); t.falsy(shell.error()); shell.ln('-s', '../../../2', 'link'); t.falsy(shell.error()); shell.ln('-s', './5/6/7', 'link1'); t.falsy(shell.error()); shell.cd('../../../../../..'); t.falsy(shell.error()); t.truthy(shell.test('-d', t.context.tmp)); shell.cp('-r', `${t.context.tmp}/0/1`, `${t.context.tmp}/copytestdepth`); t.falsy(shell.error()); t.truthy(shell.test('-d', `${t.context.tmp}/copytestdepth/1/2/3/4/link/3/4/link/3/4`)); }); }); test('cp -L follows symlinks', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-s', `${t.context.tmp}/0`, `${t.context.tmp}/symlinktest`), () => { shell.mkdir('-p', `${t.context.tmp}/sub`); shell.mkdir('-p', `${t.context.tmp}/new`); shell.cp('-f', 'test/resources/file1.txt', `${t.context.tmp}/sub/file.txt`); shell.cd(`${t.context.tmp}/sub`); shell.ln('-s', 'file.txt', 'foo.lnk'); shell.ln('-s', 'file.txt', 'sym.lnk'); shell.cd('..'); shell.cp('-L', 'sub/*', 'new/'); shell.cd('new'); shell.cp('-f', '../../test/resources/file2.txt', 'file.txt'); t.is(shell.cat('file.txt').toString(), 'test2\n'); // Ensure other files have not changed. t.is(shell.cat('foo.lnk').toString(), 'test1\n'); t.is(shell.cat('sym.lnk').toString(), 'test1\n'); t.falsy(shell.test('-L', 'foo.lnk')); t.falsy(shell.test('-L', 'sym.lnk')); shell.cd('../..'); }); }); test('Test with recursive option and symlinks.', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-s', `${t.context.tmp}/0`, `${t.context.tmp}/symlinktest`), () => { shell.mkdir('-p', `${t.context.tmp}/sub/sub1`); shell.cp('-f', 'test/resources/file1.txt', `${t.context.tmp}/sub/file.txt`); shell.cp('-f', 'test/resources/file1.txt', `${t.context.tmp}/sub/sub1/file.txt`); shell.cd(`${t.context.tmp}/sub`); shell.ln('-s', 'file.txt', 'foo.lnk'); shell.ln('-s', 'file.txt', 'sym.lnk'); shell.cd('sub1'); shell.ln('-s', '../file.txt', 'foo.lnk'); shell.ln('-s', '../file.txt', 'sym.lnk'); // Ensure file reads from proper source t.is(shell.cat('file.txt').toString(), 'test1\n'); t.is(shell.cat('foo.lnk').toString(), 'test1\n'); t.is(shell.cat('sym.lnk').toString(), 'test1\n'); t.truthy(shell.test('-L', 'foo.lnk')); t.truthy(shell.test('-L', 'sym.lnk')); shell.cd('../..'); shell.cp('-rL', 'sub/', 'new/'); shell.cd('new'); // Ensure copies of files are symlinks by updating file contents. shell.cp('-f', '../../test/resources/file2.txt', 'file.txt'); t.is(shell.cat('file.txt').toString(), 'test2\n'); // Ensure other files have not changed. t.is(shell.cat('foo.lnk').toString(), 'test1\n'); t.is(shell.cat('sym.lnk').toString(), 'test1\n'); // Ensure the links are converted to files. t.falsy(shell.test('-L', 'foo.lnk')); t.falsy(shell.test('-L', 'sym.lnk')); // Ensure other files have not changed. shell.cd('sub1'); shell.cp('-f', '../../../test/resources/file2.txt', 'file.txt'); t.is(shell.cat('file.txt').toString(), 'test2\n'); t.is(shell.cat('foo.lnk').toString(), 'test1\n'); t.is(shell.cat('sym.lnk').toString(), 'test1\n'); // Ensure the links are converted to files t.falsy(shell.test('-L', 'foo.lnk')); t.falsy(shell.test('-L', 'sym.lnk')); }); }); test('recursive, with a non-normalized path', t => { const result = shell.cp('-R', 'test/resources/../resources/./cp', t.context.tmp); t.falsy(shell.error()); // crash test only t.falsy(result.stderr); t.is(result.code, 0); }); test('copy file to same path', t => { const result = shell.cp('test/resources/file1', 'test/resources/file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "cp: 'test/resources/file1' and 'test/resources/file1' are the same file"); }); test('copy file to same directory', t => { const result = shell.cp('test/resources/file1', 'test/resources'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "cp: 'test/resources/file1' and 'test/resources/file1' are the same file"); }); test('copy mutliple files to same location', t => { const result = shell.cp('test/resources/file1', 'test/resources/file2', 'test/resources'); t.truthy(shell.error()); t.is(result.code, 1); t.is( result.stderr, "cp: 'test/resources/file1' and 'test/resources/file1' are the same file\n" + "cp: 'test/resources/file2' and 'test/resources/file2' are the same file" ); }); test('should not overwrite recently created files', t => { const result = shell.cp('test/resources/file1', 'test/resources/cp/file1', t.context.tmp); t.truthy(shell.error()); t.is(result.code, 1); // Ensure First file is copied t.is(shell.cat(`${t.context.tmp}/file1`).toString(), 'test1'); t.is( result.stderr, `cp: will not overwrite just-created '${t.context.tmp}/file1' with 'test/resources/cp/file1'` ); }); test('should not overwrite recently created files (in recursive Mode)', t => { const result = shell.cp('-R', 'test/resources/file1', 'test/resources/cp/file1', t.context.tmp); t.truthy(shell.error()); t.is(result.code, 1); // Ensure First file is copied t.is(shell.cat(`${t.context.tmp}/file1`).toString(), 'test1'); t.is( result.stderr, `cp: will not overwrite just-created '${t.context.tmp}/file1' with 'test/resources/cp/file1'` ); }); test('should not overwrite recently created files (not give error no-force mode)', t => { const result = shell.cp('-n', 'test/resources/file1', 'test/resources/cp/file1', t.context.tmp); t.falsy(shell.error()); t.is(result.code, 0); // Ensure First file is copied t.is(shell.cat(`${t.context.tmp}/file1`).toString(), 'test1'); }); // cp -R should be able to copy a readonly src (issue #98). // On Windows, chmod acts VERY differently so skip these tests for now test('cp -R should be able to copy a readonly src. issue #98; (Non window platforms only)', t => { utils.skipOnWin(t, () => { shell.cp('-r', 'test/resources/cp', t.context.tmp); shell.chmod('555', `${t.context.tmp}/cp/`); shell.chmod('555', `${t.context.tmp}/cp/dir_a`); shell.chmod('555', `${t.context.tmp}/cp/dir_b`); shell.chmod('555', `${t.context.tmp}/cp/a`); const result = shell.cp('-r', `${t.context.tmp}/cp`, `${t.context.tmp}/cp_cp`); t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); t.is(shell.ls('-R', `${t.context.tmp}/cp`) + '', shell.ls('-R', `${t.context.tmp}/cp_cp`) + ''); t.is(fs.statSync(`${t.context.tmp}/cp_cp`).mode & parseInt('777', 8), parseInt('555', 8)); t.is(fs.statSync(`${t.context.tmp}/cp_cp/dir_a`).mode & parseInt('777', 8), parseInt('555', 8)); t.is(fs.statSync(`${t.context.tmp}/cp_cp/a`).mode & parseInt('777', 8), parseInt('555', 8)); shell.chmod('-R', '755', t.context.tmp); }); }); node-shelljs-0.8.3/test/dirs.js000066400000000000000000000014161342005425100163650ustar00rootroot00000000000000import path from 'path'; import test from 'ava'; import shell from '..'; test.beforeEach(() => { shell.config.resetForTesting(); shell.pushd('test/resources/pushd'); shell.pushd('a'); }); // // Valids // const trail = [ path.resolve(path.resolve(), 'test/resources/pushd/a'), path.resolve(path.resolve(), 'test/resources/pushd'), path.resolve(), ]; test('no arguments', t => { t.deepEqual(shell.dirs(), trail); }); test('Single items', t => { t.is(shell.dirs('+0'), trail[0]); t.is(shell.dirs('+1'), trail[1]); t.is(shell.dirs('+2'), trail[2]); t.is(shell.dirs('-0'), trail[2]); t.is(shell.dirs('-1'), trail[1]); t.is(shell.dirs('-2'), trail[0]); }); test('Clearing items', t => { t.deepEqual(shell.dirs('-c'), []); t.falsy(shell.error()); }); node-shelljs-0.8.3/test/echo.js000066400000000000000000000073021342005425100163420ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; import utils from './utils/utils'; import mocks from './utils/mocks'; shell.config.silent = true; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); mocks.init(); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); mocks.restore(); }); // // Valids // test('simple test with defaults', t => { const result = shell.echo('hello', 'world'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, 'hello world\n'); t.is(stderr, ''); }); test('allow arguments to begin with a hyphen', t => { // Github issue #20 const result = shell.echo('-asdf', '111'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 1); t.is(stdout, '-asdf 111\n'); t.is(stderr, ''); }); test("using null as an explicit argument doesn't crash the function", t => { const result = shell.echo(null); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, 'null\n'); t.is(stderr, ''); }); test('-e option', t => { const result = shell.echo('-e', '\tmessage'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, '\tmessage\n'); t.is(stderr, ''); }); test('piping to a file', t => { // Github issue #476 shell.mkdir(t.context.tmp); const tmp = `${t.context.tmp}/echo.txt`; const resultA = shell.echo('A').toEnd(tmp); t.falsy(shell.error()); t.is(resultA.code, 0); const resultB = shell.echo('B').toEnd(tmp); t.falsy(shell.error()); t.is(resultB.code, 0); const result = shell.cat(tmp); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, 'A\nB\n'); t.is(stderr, ''); t.is(result.toString(), 'A\nB\n'); }); test('-n option', t => { const result = shell.echo('-n', 'message'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, 'message'); t.is(stderr, ''); }); test('-ne option', t => { const result = shell.echo('-ne', 'message'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, 'message'); t.is(stderr, ''); }); test('-en option', t => { const result = shell.echo('-en', 'message'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, 'message'); t.is(stderr, ''); }); test('-en option with escaped characters', t => { const result = shell.echo('-en', '\tmessage\n'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 0); t.is(stdout, '\tmessage\n'); t.is(stderr, ''); }); test('piping to a file with -n', t => { // Github issue #476 shell.mkdir(t.context.tmp); const tmp = `${t.context.tmp}/echo.txt`; const resultA = shell.echo('-n', 'A').toEnd(tmp); t.falsy(shell.error()); t.is(resultA.code, 0); const resultB = shell.echo('-n', 'B').toEnd(tmp); t.falsy(shell.error()); t.is(resultB.code, 0); const result = shell.cat(tmp); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, 'AB'); t.is(stderr, ''); t.is(result.toString(), 'AB'); }); test('stderr with unrecognized options is empty', t => { const result = shell.echo('-asdf'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(result.code, 1); t.falsy(result.stderr); t.is(stdout, '-asdf\n'); t.is(stderr, ''); }); node-shelljs-0.8.3/test/env.js000066400000000000000000000004771342005425100162220ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; shell.config.silent = true; // // Valids // test('existing variables', t => { t.is(shell.env.PATH, process.env.PATH); }); test('variables are exported', t => { shell.env.SHELLJS_TEST = 'hello world'; t.is(shell.env.SHELLJS_TEST, process.env.SHELLJS_TEST); }); node-shelljs-0.8.3/test/exec.js000066400000000000000000000161271342005425100163550ustar00rootroot00000000000000import os from 'os'; import path from 'path'; import util from 'util'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; import mocks from './utils/mocks'; const CWD = process.cwd(); const ORIG_EXEC_PATH = shell.config.execPath; shell.config.silent = true; test.beforeEach(() => { mocks.init(); }); test.afterEach.always(() => { process.chdir(CWD); shell.config.execPath = ORIG_EXEC_PATH; mocks.restore(); }); // // Invalids // test('no args', t => { shell.exec(); t.truthy(shell.error()); }); test('unknown command', t => { const result = shell.exec('asdfasdf'); // could not find command t.truthy(result.code > 0); }); test('config.fatal and unknown command', t => { const oldFatal = shell.config.fatal; shell.config.fatal = true; t.throws(() => { shell.exec('asdfasdf'); // could not find command }, /asdfasdf/); // name of command should be in error message shell.config.fatal = oldFatal; }); test('exec exits gracefully if we cannot find the execPath', t => { shell.config.execPath = null; shell.exec('echo foo'); t.regex( shell.error(), /Unable to find a path to the node binary\. Please manually set config\.execPath/ ); }); test('cannot require exec-child.js', t => { t.throws(() => { require('../src/exec-child.js'); }, /This file should not be required/); }); // // Valids // // // sync // test('check if stdout goes to output', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(1234);"`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, '1234\n'); }); test('check if stderr goes to output', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.error(1234);"`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, ''); t.is(result.stderr, '1234\n'); }); test('check if stdout + stderr go to output', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.error(1234); console.log(666);"`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, '666\n'); t.is(result.stderr, '1234\n'); }); test('check if stdout + stderr should not be printed to console if silent', t => { shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.error(1234); console.log(666); process.exit(12);"`, { silent: true }); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.is(stdout, ''); t.is(stderr, ''); }); test('check exit code', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "process.exit(12);"`); t.truthy(shell.error()); t.is(result.code, 12); }); test('interaction with cd', t => { shell.cd('test/resources/external'); const result = shell.exec(`${JSON.stringify(shell.config.execPath)} node_script.js`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, 'node_script_1234\n'); }); test('check quotes escaping', t => { const result = shell.exec(util.format(JSON.stringify(shell.config.execPath) + ' -e "console.log(%s);"', "\\\"\\'+\\'_\\'+\\'\\\"")); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, "'+'_'+'\n"); }); test('set cwd', t => { const cmdString = process.platform === 'win32' ? 'cd' : 'pwd'; const result = shell.exec(cmdString, { cwd: '..' }); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, path.resolve('..') + os.EOL); }); test('set maxBuffer (very small)', t => { const result = shell.exec('echo 1234567890'); // default maxBuffer is ok t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, '1234567890' + os.EOL); shell.exec('echo 1234567890', { maxBuffer: 6 }); t.truthy(shell.error()); }); test('set timeout option', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} test/resources/exec/slow.js 100`); // default timeout is ok t.falsy(shell.error()); t.is(result.code, 0); shell.exec(`${JSON.stringify(shell.config.execPath)} test/resources/exec/slow.js 2000`, { timeout: 1000 }); // times out t.truthy(shell.error()); }); test('check process.env works', t => { t.falsy(shell.env.FOO); shell.env.FOO = 'Hello world'; const result = shell.exec(process.platform !== 'win32' ? 'echo $FOO' : 'echo %FOO%'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, 'Hello world' + os.EOL); t.is(result.stderr, ''); }); test('set shell option (TODO: add tests for Windows)', t => { utils.skipOnWin(t, () => { let result = shell.exec('echo $0'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, '/bin/sh\n'); // sh by default const bashPath = shell.which('bash').trim(); if (bashPath) { result = shell.exec('echo $0', { shell: '/bin/bash' }); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.stdout, '/bin/bash\n'); } }); }); test('exec returns a ShellString', t => { const result = shell.exec('echo foo'); t.is(typeof result, 'object'); t.truthy(result instanceof String); t.is(typeof result.stdout, 'string'); t.is(result.toString(), result.stdout); }); test('encoding option works', t => { const result = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(1234);"`, { encoding: 'buffer' }); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(Buffer.isBuffer(result.stdout)); t.truthy(Buffer.isBuffer(result.stderr)); t.is(result.stdout.toString(), '1234\n'); t.is(result.stderr.toString(), ''); }); // // async // test.cb('no callback', t => { const c = shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(1234)"`, { async: true }); t.falsy(shell.error()); t.truthy('stdout' in c, 'async exec returns child process object'); t.end(); }); test.cb('callback as 2nd argument', t => { shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(5678);"`, (code, stdout, stderr) => { t.is(code, 0); t.is(stdout, '5678\n'); t.is(stderr, ''); t.end(); }); }); test.cb('callback as end argument', t => { shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(5566);"`, { async: true }, (code, stdout, stderr) => { t.is(code, 0); t.is(stdout, '5566\n'); t.is(stderr, ''); t.end(); }); }); test.cb('callback as 3rd argument (silent:true)', t => { shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(5678);"`, { silent: true }, (code, stdout, stderr) => { t.is(code, 0); t.is(stdout, '5678\n'); t.is(stderr, ''); t.end(); }); }); test.cb('command that fails', t => { shell.exec('shx cp onlyOneCpArgument.txt', { silent: true }, (code, stdout, stderr) => { t.is(code, 1); t.is(stdout, ''); t.is(stderr, 'cp: missing and/or \n'); t.end(); }); }); test.cb('encoding option works with async', t => { shell.exec(`${JSON.stringify(shell.config.execPath)} -e "console.log(5566);"`, { async: true, encoding: 'buffer' }, (code, stdout, stderr) => { t.is(code, 0); t.truthy(Buffer.isBuffer(stdout)); t.truthy(Buffer.isBuffer(stderr)); t.is(stdout.toString(), '5566\n'); t.is(stderr.toString(), ''); t.end(); }); }); node-shelljs-0.8.3/test/find.js000066400000000000000000000034331342005425100163450ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; const CWD = process.cwd(); test.beforeEach(() => { shell.config.resetForTesting(); process.chdir(CWD); }); // // Invalids // test('no args', t => { const result = shell.find(); t.is(result.code, 1); t.truthy(shell.error()); }); // // Valids // test('current path', t => { shell.cd('test/resources/find'); const result = shell.find('.'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('.hidden') > -1); t.truthy(result.indexOf('dir1/dir11/a_dir11') > -1); t.is(result.length, 11); shell.cd('../..'); }); test('simple path', t => { const result = shell.find('test/resources/find'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/find/.hidden') > -1); t.truthy(result.indexOf('test/resources/find/dir1/dir11/a_dir11') > -1); t.is(result.length, 11); }); test('multiple paths - comma', t => { const result = shell.find('test/resources/find/dir1', 'test/resources/find/dir2'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/find/dir1/dir11/a_dir11') > -1); t.truthy(result.indexOf('test/resources/find/dir2/a_dir1') > -1); t.is(result.length, 6); }); test('multiple paths - array', t => { const result = shell.find(['test/resources/find/dir1', 'test/resources/find/dir2']); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/find/dir1/dir11/a_dir11') > -1); t.truthy(result.indexOf('test/resources/find/dir2/a_dir1') > -1); t.is(result.length, 6); }); test('nonexistent path', t => { const result = shell.find('test/resources/find/nonexistent'); t.is(shell.error(), 'find: no such file or directory: test/resources/find/nonexistent'); t.is(result.code, 1); }); node-shelljs-0.8.3/test/global.js000066400000000000000000000021711342005425100166630ustar00rootroot00000000000000/* globals cat, config, cp, env, error, mkdir, rm */ import fs from 'fs'; import test from 'ava'; import '../global'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); config.resetForTesting(); mkdir(t.context.tmp); }); test.afterEach.always(t => { rm('-rf', t.context.tmp); }); // // Valids // test('env is exported', t => { t.is(process.env, env); }); test('cat', t => { const result = cat('test/resources/cat/file1'); t.falsy(error()); t.is(result.code, 0); t.is(result.toString(), 'test1\n'); }); test('rm', t => { cp('-f', 'test/resources/file1', `${t.context.tmp}/file1`); t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); const result = rm(`${t.context.tmp}/file1`); t.falsy(error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); }); test('String.prototype is modified for global require', t => { 'foo'.to(`${t.context.tmp}/testfile.txt`); t.is('foo', cat(`${t.context.tmp}/testfile.txt`).toString()); 'bar'.toEnd(`${t.context.tmp}/testfile.txt`); t.is('foobar', cat(`${t.context.tmp}/testfile.txt`).toString()); }); node-shelljs-0.8.3/test/grep.js000066400000000000000000000105451342005425100163640ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no args', t => { const result = shell.grep(); t.truthy(shell.error()); t.is(result.code, 2); }); test('too few args', t => { const result = shell.grep(/asdf/g); // too few args t.truthy(shell.error()); t.is(result.code, 2); }); test('no such file', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.grep(/asdf/g, '/asdfasdf'); // no such file t.truthy(shell.error()); t.is(result.stderr, 'grep: no such file or directory: /asdfasdf'); t.is(result.code, 2); }); test('if at least one file is missing, this should be an error', t => { t.falsy(fs.existsSync('asdfasdf')); // sanity check t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); // sanity check const result = shell.grep(/asdf/g, `${t.context.tmp}/file1`, 'asdfasdf'); t.truthy(shell.error()); t.is(result.stderr, 'grep: no such file or directory: asdfasdf'); t.is(result.code, 2); }); // // Valids // test('basic', t => { const result = shell.grep('line', 'test/resources/a.txt'); t.falsy(shell.error()); t.is(result.split('\n').length - 1, 4); }); test('-v option', t => { const result = shell.grep('-v', 'line', 'test/resources/a.txt'); t.falsy(shell.error()); t.is(result.split('\n').length - 1, 8); }); test('matches one line', t => { const result = shell.grep('line one', 'test/resources/a.txt'); t.falsy(shell.error()); t.is(result.toString(), 'This is line one\n'); }); test('multiple files', t => { const result = shell.grep(/test/, 'test/resources/file1.txt', 'test/resources/file2.txt'); t.falsy(shell.error()); t.is(result.toString(), 'test1\ntest2\n'); }); test('multiple files, array syntax', t => { const result = shell.grep(/test/, ['test/resources/file1.txt', 'test/resources/file2.txt']); t.falsy(shell.error()); t.is(result.toString(), 'test1\ntest2\n'); }); test('multiple files, glob syntax, * for file name', t => { const result = shell.grep(/test/, 'test/resources/file*.txt'); t.falsy(shell.error()); t.truthy(result.toString(), 'test1\ntest2\n'); }); test('multiple files, glob syntax, * for directory name', t => { const result = shell.grep(/test/, 'test/r*/file*.txt'); t.falsy(shell.error()); t.is(result.toString(), 'test1\ntest2\n'); }); test('multiple files, double-star glob', t => { const result = shell.grep(/test/, 'test/resources/**/file*.js'); t.falsy(shell.error()); t.is(result.toString(), 'test\ntest\ntest\ntest\n'); }); test('one file, * in regex', t => { const result = shell.grep(/alpha*beta/, 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.toString(), 'alphaaaaaaabeta\nalphbeta\n'); }); test('one file, * in string-regex', t => { const result = shell.grep('alpha*beta', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.toString(), 'alphaaaaaaabeta\nalphbeta\n'); }); test('one file, * in regex, make sure * is not globbed', t => { const result = shell.grep(/l*\.js/, 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.toString(), 'this line ends in.js\nlllllllllllllllll.js\n'); }); test('one file, * in string-regex, make sure * is not globbed', t => { const result = shell.grep('l*\\.js', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.toString(), 'this line ends in.js\nlllllllllllllllll.js\n'); }); test('-l option', t => { const result = shell.grep('-l', 'test1', 'test/resources/file1', 'test/resources/file2', 'test/resources/file1.txt'); t.falsy(shell.error()); t.truthy(result.match(/file1(\n|$)/)); t.truthy(result.match(/file1.txt/)); t.falsy(result.match(/file2.txt/)); t.is(result.split('\n').length - 1, 2); }); test('-i option', t => { const result = shell.grep('-i', 'test', 'test/resources/grep/case1', 'test/resources/grep/case1.txt', 'test/resources/grep/case1.js'); t.falsy(shell.error()); t.is(result.split('\n').length - 1, 3); }); test('the pattern looks like an option', t => { const result = shell.grep('--', '-v', 'test/resources/grep/file2'); t.falsy(shell.error()); t.is(result.toString(), '-v\n-vv\n'); }); node-shelljs-0.8.3/test/head.js000066400000000000000000000103611342005425100163240ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; shell.config.silent = true; // // Invalids // test('no args', t => { const result = shell.head(); t.truthy(shell.error()); t.is(result.code, 1); }); test('file does not exist', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.head('/asdfasdf'); // file does not exist t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'head: no such file or directory: /asdfasdf'); }); test('directory', t => { t.truthy(common.statFollowLinks('test/resources/').isDirectory()); // sanity check const result = shell.head('test/resources/'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "head: error reading 'test/resources/': Is a directory"); }); // // Valids // const topOfFile1 = ['file1 1', 'file1 2', 'file1 3', 'file1 4', 'file1 5', 'file1 6', 'file1 7', 'file1 8', 'file1 9', 'file1 10', 'file1 11', 'file1 12', 'file1 13', 'file1 14', 'file1 15', 'file1 16', 'file1 17', 'file1 18', 'file1 19', 'file1 20']; const topOfFile2 = ['file2 1', 'file2 2', 'file2 3', 'file2 4', 'file2 5', 'file2 6', 'file2 7', 'file2 8', 'file2 9', 'file2 10', 'file2 11', 'file2 12', 'file2 13', 'file2 14', 'file2 15', 'file2 16', 'file2 17', 'file2 18', 'file2 19', 'file2 20']; test('simple', t => { const result = shell.head('test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile1.slice(0, 10).join('\n') + '\n'); }); test('multiple files', t => { const result = shell.head('test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile2 .slice(0, 10) .concat(topOfFile1.slice(0, 10)) .join('\n') + '\n'); }); test('multiple files, array syntax', t => { const result = shell.head(['test/resources/head/file2.txt', 'test/resources/head/file1.txt']); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile2 .slice(0, 10) .concat(topOfFile1.slice(0, 10)) .join('\n') + '\n'); }); test('reading more lines than are in the file (no trailing newline)', t => { const result = shell.head('test/resources/file2', 'test/resources/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test2\ntest1'); // these files only have one line (no \n) }); test('reading more lines than are in the file (with trailing newline)', t => { const result = shell.head('test/resources/head/shortfile2', 'test/resources/head/shortfile1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'short2\nshort1\n'); // these files only have one line (with \n) }); test('Globbed file', t => { const result = shell.head('test/resources/head/file?.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile1 .slice(0, 10) .concat(topOfFile2.slice(0, 10)) .join('\n') + '\n'); }); test('With `\'-n\' ` option', t => { const result = shell.head('-n', 4, 'test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile2 .slice(0, 4) .concat(topOfFile1.slice(0, 4)) .join('\n') + '\n'); }); test('With `{\'-n\': }` option', t => { const result = shell.head({ '-n': 4 }, 'test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile2 .slice(0, 4) .concat(topOfFile1.slice(0, 4)) .join('\n') + '\n'); }); test('negative values (-num) are the same as (numLines - num)', t => { const result = shell.head('-n', -46, 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'file1 1\nfile1 2\nfile1 3\nfile1 4\n'); }); test('right-hand side of a pipe', t => { const result = shell.cat('test/resources/head/file1.txt').head(); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), topOfFile1.slice(0, 10).join('\n') + '\n'); }); node-shelljs-0.8.3/test/ln.js000066400000000000000000000141151342005425100160350ustar00rootroot00000000000000import fs from 'fs'; import path from 'path'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; const CWD = process.cwd(); test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); process.chdir(CWD); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no args', t => { const result = shell.ln(); t.truthy(shell.error()); t.is(result.code, 1); }); test('too few args', t => { const result = shell.ln('file'); t.truthy(shell.error()); t.is(result.code, 1); }); test('only an option', t => { const result = shell.ln('-f'); t.truthy(shell.error()); t.is(result.code, 1); }); test('destination already exists', t => { const result = shell.ln(`${t.context.tmp}/file1`, `${t.context.tmp}/file2`); t.truthy(shell.error()); t.is(result.code, 1); }); test('non-existent source', t => { const result = shell.ln(`${t.context.tmp}/noexist`, `${t.context.tmp}/linkfile1`); t.truthy(shell.error()); t.is(result.code, 1); }); test('non-existent source (-sf)', t => { const result = shell.ln('-sf', 'no/exist', `${t.context.tmp}/badlink`); t.truthy(shell.error()); t.is(result.code, 1); }); test('non-existent source (-f)', t => { const result = shell.ln('-f', 'noexist', `${t.context.tmp}/badlink`); t.truthy(shell.error()); t.is(result.code, 1); }); // // Valids // test('basic usage', t => { const result = shell.ln(`${t.context.tmp}/file1`, `${t.context.tmp}/linkfile1`); t.truthy(fs.existsSync(`${t.context.tmp}/linkfile1`)); t.is( fs.readFileSync(`${t.context.tmp}/file1`).toString(), fs.readFileSync(`${t.context.tmp}/linkfile1`).toString() ); fs.writeFileSync(`${t.context.tmp}/file1`, 'new content 1'); t.is(fs.readFileSync(`${t.context.tmp}/linkfile1`).toString(), 'new content 1'); t.is(result.code, 0); }); test('With glob', t => { shell.rm(`${t.context.tmp}/linkfile1`); const result = shell.ln(`${t.context.tmp}/fi*1`, `${t.context.tmp}/linkfile1`); t.truthy(fs.existsSync(`${t.context.tmp}/linkfile1`)); t.is( fs.readFileSync(`${t.context.tmp}/file1`).toString(), fs.readFileSync(`${t.context.tmp}/linkfile1`).toString() ); fs.writeFileSync(`${t.context.tmp}/file1`, 'new content 1'); t.is(fs.readFileSync(`${t.context.tmp}/linkfile1`).toString(), 'new content 1'); t.is(result.code, 0); }); test('-s option', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-s', 'file2', `${t.context.tmp}/linkfile2`), () => { t.truthy(fs.existsSync(`${t.context.tmp}/linkfile2`)); t.is( fs.readFileSync(`${t.context.tmp}/file2`).toString(), fs.readFileSync(`${t.context.tmp}/linkfile2`).toString() ); fs.writeFileSync(`${t.context.tmp}/file2`, 'new content 2'); t.is(fs.readFileSync(`${t.context.tmp}/linkfile2`).toString(), 'new content 2'); }); }); test('Symbolic link directory test', t => { shell.mkdir(`${t.context.tmp}/ln`); shell.touch(`${t.context.tmp}/ln/hello`); const result = shell.ln('-s', 'ln', `${t.context.tmp}/dir1`); t.truthy(fs.existsSync(`${t.context.tmp}/ln/hello`)); t.truthy(fs.existsSync(`${t.context.tmp}/dir1/hello`)); t.is(result.code, 0); }); test('To current directory', t => { shell.cd(t.context.tmp); let result = shell.ln('-s', './', 'dest'); t.is(result.code, 0); shell.touch('testfile.txt'); t.truthy(fs.existsSync('testfile.txt')); t.truthy(fs.existsSync('dest/testfile.txt')); shell.rm('-f', 'dest'); shell.mkdir('dir1'); shell.cd('dir1'); result = shell.ln('-s', './', '../dest'); t.is(result.code, 0); shell.touch('insideDir.txt'); shell.cd('..'); t.truthy(fs.existsSync('testfile.txt')); t.truthy(fs.existsSync('dest/testfile.txt')); t.truthy(fs.existsSync('dir1/insideDir.txt')); t.falsy(fs.existsSync('dest/insideDir.txt')); shell.cd('..'); }); test('-f option', t => { const result = shell.ln('-f', `${t.context.tmp}/file1.js`, `${t.context.tmp}/file2.js`); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/file2.js`)); t.is( fs.readFileSync(`${t.context.tmp}/file1.js`).toString(), fs.readFileSync(`${t.context.tmp}/file2.js`).toString() ); fs.writeFileSync(`${t.context.tmp}/file1.js`, 'new content js'); t.is(fs.readFileSync(`${t.context.tmp}/file2.js`).toString(), 'new content js'); }); test('-sf option', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-sf', 'file1.txt', `${t.context.tmp}/file2.txt`), () => { t.truthy(fs.existsSync(`${t.context.tmp}/file2.txt`)); t.is( fs.readFileSync(`${t.context.tmp}/file1.txt`).toString(), fs.readFileSync(`${t.context.tmp}/file2.txt`).toString() ); fs.writeFileSync(`${t.context.tmp}/file1.txt`, 'new content txt'); t.is(fs.readFileSync(`${t.context.tmp}/file2.txt`).toString(), 'new content txt'); }); }); test('Abspath regression', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-sf', 'file1', path.resolve(`${t.context.tmp}/abspath`)), () => { t.truthy(fs.existsSync(`${t.context.tmp}/abspath`)); t.is( fs.readFileSync(`${t.context.tmp}/file1`).toString(), fs.readFileSync(`${t.context.tmp}/abspath`).toString() ); fs.writeFileSync(`${t.context.tmp}/file1`, 'new content 3'); t.is(fs.readFileSync(`${t.context.tmp}/abspath`).toString(), 'new content 3'); }); }); test('Relative regression', t => { utils.skipOnWinForEPERM(shell.ln.bind(shell, '-sf', 'file1.txt', `${t.context.tmp}/file2.txt`), () => { shell.mkdir('-p', `${t.context.tmp}/new`); // Move the symlink first, as the reverse confuses `mv`. shell.mv(`${t.context.tmp}/file2.txt`, `${t.context.tmp}/new/file2.txt`); shell.mv(`${t.context.tmp}/file1.txt`, `${t.context.tmp}/new/file1.txt`); t.truthy(fs.existsSync(`${t.context.tmp}/new/file2.txt`)); t.is( fs.readFileSync(`${t.context.tmp}/new/file1.txt`).toString(), fs.readFileSync(`${t.context.tmp}/new/file2.txt`).toString() ); fs.writeFileSync(`${t.context.tmp}/new/file1.txt`, 'new content txt'); t.is(fs.readFileSync(`${t.context.tmp}/new/file2.txt`).toString(), 'new content txt'); }); }); node-shelljs-0.8.3/test/ls.js000066400000000000000000000432051342005425100160440ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; const CWD = process.cwd(); test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { process.chdir(CWD); shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no such file or dir', t => { t.falsy(fs.existsSync('/asdfasdf')); const result = shell.ls('/asdfasdf'); // no such file or dir t.truthy(shell.error()); t.is(result.code, 2); t.is(result.length, 0); }); // // Valids // test('it\'s ok to use no arguments', t => { const result = shell.ls(); t.falsy(shell.error()); t.is(result.code, 0); }); test('root directory', t => { const result = shell.ls('/'); t.falsy(shell.error()); t.is(result.code, 0); }); test('no args provides the correct result', t => { shell.cd('test/resources/ls'); const result = shell.ls(); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('file1') > -1); t.truthy(result.indexOf('file2') > -1); t.truthy(result.indexOf('file1.js') > -1); t.truthy(result.indexOf('file2.js') > -1); t.truthy(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1); t.truthy(result.indexOf('a_dir') > -1); t.is(result.length, 6); }); test('simple arg', t => { const result = shell.ls('test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('file1') > -1); t.truthy(result.indexOf('file2') > -1); t.truthy(result.indexOf('file1.js') > -1); t.truthy(result.indexOf('file2.js') > -1); t.truthy(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1); t.truthy(result.indexOf('a_dir') > -1); t.is(result.length, 6); }); test('simple arg, with a trailing slash', t => { const result = shell.ls('test/resources/ls/'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('file1') > -1); t.truthy(result.indexOf('file2') > -1); t.truthy(result.indexOf('file1.js') > -1); t.truthy(result.indexOf('file2.js') > -1); t.truthy(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1); t.truthy(result.indexOf('a_dir') > -1); t.is(result.length, 6); }); test('simple arg, a file', t => { const result = shell.ls('test/resources/ls/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.is(result.length, 1); }); test('no args, -A option', t => { shell.cd('test/resources/ls'); const result = shell.ls('-A'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('file1') > -1); t.truthy(result.indexOf('file2') > -1); t.truthy(result.indexOf('file1.js') > -1); t.truthy(result.indexOf('file2.js') > -1); t.truthy(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('.hidden_file') > -1); t.truthy(result.indexOf('.hidden_dir') > -1); t.is(result.length, 8); }); test('no args, deprecated -a option', t => { shell.cd('test/resources/ls'); const result = shell.ls('-a'); // (deprecated) backwards compatibility test t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('file1') > -1); t.truthy(result.indexOf('file2') > -1); t.truthy(result.indexOf('file1.js') > -1); t.truthy(result.indexOf('file2.js') > -1); t.truthy(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('.hidden_file') > -1); t.truthy(result.indexOf('.hidden_dir') > -1); t.is(result.length, 8); }); test('wildcard, very simple', t => { const result = shell.ls('test/resources/cat/*'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/cat/file1') > -1); t.truthy(result.indexOf('test/resources/cat/file2') > -1); t.truthy(result.indexOf('test/resources/cat/file3') > -1); t.truthy(result.indexOf('test/resources/cat/file4') > -1); t.truthy(result.indexOf('test/resources/cat/file5') > -1); t.is(result.length, 5); }); test('wildcard, simple', t => { const result = shell.ls('test/resources/ls/*'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.truthy(result.indexOf('test/resources/ls/file2') > -1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy( result.indexOf('test/resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1 ); t.is(result.indexOf('test/resources/ls/a_dir'), -1); // this shouldn't be there t.truthy(result.indexOf('nada') > -1); t.truthy(result.indexOf('b_dir') > -1); t.is(result.length, 7); }); test('wildcard, simple, with -d', t => { const result = shell.ls('-d', 'test/resources/ls/*'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.truthy(result.indexOf('test/resources/ls/file2') > -1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy( result.indexOf('test/resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1 ); t.truthy(result.indexOf('test/resources/ls/a_dir') > -1); t.is(result.length, 6); }); test('wildcard, hidden only', t => { const result = shell.ls('-d', 'test/resources/ls/.*'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/.hidden_file') > -1); t.truthy(result.indexOf('test/resources/ls/.hidden_dir') > -1); t.is(result.length, 2); }); test('wildcard, mid-file', t => { const result = shell.ls('test/resources/ls/f*le*'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 5); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.truthy(result.indexOf('test/resources/ls/file2') > -1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy( result.indexOf('test/resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1 ); }); test('wildcard, mid-file with dot (should escape dot for regex)', t => { const result = shell.ls('test/resources/ls/f*le*.js'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 2); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); }); test('one file that exists, one that doesn\'t', t => { const result = shell.ls('test/resources/ls/file1.js', 'test/resources/ls/thisdoesntexist'); t.truthy(shell.error()); t.is(result.code, 2); t.is(result.length, 1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); }); test('one file that exists, one that doesn\'t (other order)', t => { const result = shell.ls('test/resources/ls/thisdoesntexist', 'test/resources/ls/file1.js'); t.truthy(shell.error()); t.is(result.code, 2); t.is(result.length, 1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); }); test('wildcard, should not do partial matches', t => { const result = shell.ls('test/resources/ls/*.j'); // shouldn't get .js t.truthy(shell.error()); t.is(result.code, 2); t.is(result.length, 0); }); test('wildcard, all files with extension', t => { const result = shell.ls('test/resources/ls/*.*'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 3); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy( result.indexOf('test/resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1 ); }); test('wildcard, with additional path', t => { const result = shell.ls('test/resources/ls/f*le*.js', 'test/resources/ls/a_dir'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 4); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy(result.indexOf('b_dir') > -1); // no wildcard == no path prefix t.truthy(result.indexOf('nada') > -1); // no wildcard == no path prefix }); test('wildcard for both paths', t => { const result = shell.ls('test/resources/ls/f*le*.js', 'test/resources/ls/a_dir/*'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 4); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy(result.indexOf('z') > -1); t.truthy(result.indexOf('test/resources/ls/a_dir/nada') > -1); }); test('wildcard for both paths, array', t => { const result = shell.ls(['test/resources/ls/f*le*.js', 'test/resources/ls/a_dir/*']); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 4); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy(result.indexOf('z') > -1); t.truthy(result.indexOf('test/resources/ls/a_dir/nada') > -1); }); test('recursive, no path', t => { shell.cd('test/resources/ls'); const result = shell.ls('-R'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir/z') > -1); t.is(result.length, 9); }); test('recursive, path given', t => { const result = shell.ls('-R', 'test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir/z') > -1); t.is(result.length, 9); }); test('-RA flag, path given', t => { const result = shell.ls('-RA', 'test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir/z') > -1); t.truthy(result.indexOf('a_dir/.hidden_dir/nada') > -1); t.is(result.length, 14); }); test('-RA flag, symlinks are not followed', t => { const result = shell.ls('-RA', 'test/resources/rm'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/a_file') > -1); t.truthy(result.indexOf('link_to_a_dir') > -1); t.is(result.indexOf('link_to_a_dir/a_file'), -1); t.truthy(result.indexOf('fake.lnk') > -1); t.is(result.length, 4); }); test('-RAL flag, follows symlinks', t => { utils.skipOnWin(t, () => { const result = shell.ls('-RAL', 'test/resources/rm'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/a_file') > -1); t.truthy(result.indexOf('link_to_a_dir') > -1); t.truthy(result.indexOf('link_to_a_dir/a_file') > -1); t.truthy(result.indexOf('fake.lnk') > -1); t.is(result.length, 5); }); }); test('-L flag, path is symlink', t => { utils.skipOnWin(t, () => { const result = shell.ls('-L', 'test/resources/rm/link_to_a_dir'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_file') > -1); t.is(result.length, 1); }); }); test('follow links to directories by default', t => { utils.skipOnWin(t, () => { const result = shell.ls('test/resources/rm/link_to_a_dir'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_file') > -1); t.is(result.length, 1); }); }); test('-Rd works like -d', t => { const result = shell.ls('-Rd', 'test/resources/ls'); t.falsy(shell.error()); t.is(result.length, 1); }); test('directory option, single arg', t => { const result = shell.ls('-d', 'test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 1); }); test('directory option, single arg with trailing \'/\'', t => { const result = shell.ls('-d', 'test/resources/ls/'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.length, 1); }); test('directory option, multiple args', t => { const result = shell.ls('-d', 'test/resources/ls/a_dir', 'test/resources/ls/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/a_dir') > -1); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.is(result.length, 2); }); test('directory option, globbed arg', t => { const result = shell.ls('-d', 'test/resources/ls/*'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/ls/a_dir') > -1); t.truthy(result.indexOf('test/resources/ls/file1') > -1); t.truthy(result.indexOf('test/resources/ls/file1.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2') > -1); t.truthy(result.indexOf('test/resources/ls/file2.js') > -1); t.truthy(result.indexOf('test/resources/ls/file2') > -1); t.truthy( result.indexOf('test/resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1 ); t.is(result.length, 6); }); test('long option, single file', t => { let result = shell.ls('-l', 'test/resources/ls/file1'); t.is(result.length, 1); result = result[0]; t.falsy(shell.error()); t.truthy(result.name, 'file1'); t.is(result.nlink, 1); t.is(result.size, 5); t.truthy(result.mode); // check that these keys exist utils.skipOnWin(t, () => { t.truthy(result.uid); t.truthy(result.gid); }); t.truthy(result.mtime); // check that these keys exist t.truthy(result.atime); // check that these keys exist t.truthy(result.ctime); // check that these keys exist t.truthy(result.toString().match(/^(\d+ +){5}.*$/)); }); test('long option, glob files', t => { let result = shell.ls('-l', 'test/resources/ls/f*le1'); t.is(result.length, 1); result = result[0]; t.falsy(shell.error()); t.truthy(result.name, 'file1'); t.is(result.nlink, 1); t.is(result.size, 5); t.truthy(result.mode); // check that these keys exist utils.skipOnWin(t, () => { t.truthy(result.uid); t.truthy(result.gid); }); t.truthy(result.mtime); // check that these keys exist t.truthy(result.atime); // check that these keys exist t.truthy(result.ctime); // check that these keys exist t.truthy(result.toString().match(/^(\d+ +){5}.*$/)); }); test('long option, directory', t => { let result = shell.ls('-l', 'test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); const idx = result.map(r => r.name).indexOf('file1'); t.truthy(idx >= 0); t.is(result.length, 6); result = result[idx]; t.is(result.name, 'file1'); t.is(result.nlink, 1); t.is(result.size, 5); t.truthy(result.mode); // check that these keys exist utils.skipOnWin(t, () => { t.truthy(result.uid); t.truthy(result.gid); }); t.truthy(result.mtime); // check that these keys exist t.truthy(result.atime); // check that these keys exist t.truthy(result.ctime); // check that these keys exist t.truthy(result.toString().match(/^(\d+ +){5}.*$/)); }); test('long option, directory, recursive (and windows converts slashes)', t => { let result = shell.ls('-lR', 'test/resources/ls/'); t.falsy(shell.error()); t.is(result.code, 0); const idx = result.map(r => r.name).indexOf('a_dir/b_dir'); t.is(result.length, 9); t.truthy(idx >= 0); result = result[idx]; t.is(result.name, result.name); t.truthy(common.statFollowLinks('test/resources/ls/a_dir/b_dir').isDirectory()); t.is(typeof result.nlink, 'number'); // This can vary between the local machine and travis t.is(typeof result.size, 'number'); // This can vary between different file systems t.truthy(result.mode); // check that these keys exist utils.skipOnWin(t, () => { t.truthy(result.uid); t.truthy(result.gid); }); t.truthy(result.mtime); // check that these keys exist t.truthy(result.atime); // check that these keys exist t.truthy(result.ctime); // check that these keys exist t.truthy(result.toString().match(/^(\d+ +){5}.*$/)); }); test('still lists broken links', t => { const result = shell.ls('test/resources/badlink'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('test/resources/badlink') > -1); t.is(result.length, 1); }); test('Test new ShellString-like attributes', t => { const result = shell.ls('test/resources/ls'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.stdout.indexOf('file1') > -1); t.truthy(result.stdout.indexOf('file2') > -1); t.truthy(result.stdout.indexOf('file1.js') > -1); t.truthy(result.stdout.indexOf('file2.js') > -1); t.truthy( result.stdout.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1 ); t.truthy(result.stdout.indexOf('a_dir') > -1); t.is(typeof result.stdout, 'string'); t.truthy(result.to); t.truthy(result.toEnd); result.to(`${t.context.tmp}/testingToOutput.txt`); t.is(shell.cat(`${t.context.tmp}/testingToOutput.txt`).toString(), result.stdout); shell.rm(`${t.context.tmp}/testingToOutput.txt`); }); test('No trailing newline for ls() on empty directories', t => { shell.mkdir('foo'); t.falsy(shell.error()); const result = shell.ls('foo'); t.falsy(shell.error()); t.is(result.stdout, ''); shell.rm('-r', 'foo'); t.falsy(shell.error()); }); test('Check stderr field', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.ls('test/resources/ls/file1', '/asdfasdf'); t.truthy(shell.error()); t.is('ls: no such file or directory: /asdfasdf', result.stderr); }); test('non-normalized paths are still ok with -R', t => { const result = shell.ls('-R', 'test/resources/./ls/../ls'); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(result.indexOf('a_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir') > -1); t.truthy(result.indexOf('a_dir/b_dir/z') > -1); t.is(result.length, 9); }); node-shelljs-0.8.3/test/mkdir.js000066400000000000000000000141661342005425100165400ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no args', t => { const result = shell.mkdir(); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: no paths given'); }); test('dir already exists', t => { const mtime = common.statFollowLinks(t.context.tmp).mtime.toString(); const result = shell.mkdir(t.context.tmp); // dir already exists t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, `mkdir: path already exists: ${t.context.tmp}`); t.is(common.statFollowLinks(t.context.tmp).mtime.toString(), mtime); // didn't mess with dir }); test('Can\'t overwrite a broken link', t => { const mtime = common.statNoFollowLinks('test/resources/badlink').mtime.toString(); const result = shell.mkdir('test/resources/badlink'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: path already exists: test/resources/badlink'); t.is(common.statNoFollowLinks('test/resources/badlink').mtime.toString(), mtime); // didn't mess with file }); test('root path does not exist', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.mkdir('/asdfasdf/foobar'); // root path does not exist t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: no such file or directory: /asdfasdf'); t.falsy(fs.existsSync('/asdfasdf')); t.falsy(fs.existsSync('/asdfasdf/foobar')); }); test('try to overwrite file', t => { t.truthy(common.statFollowLinks('test/resources/file1').isFile()); const result = shell.mkdir('test/resources/file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: path already exists: test/resources/file1'); t.truthy(common.statFollowLinks('test/resources/file1').isFile()); }); test('try to overwrite file, with -p', t => { t.truthy(common.statFollowLinks('test/resources/file1').isFile()); const result = shell.mkdir('-p', 'test/resources/file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: cannot create directory test/resources/file1: File exists'); t.truthy(common.statFollowLinks('test/resources/file1').isFile()); }); test('try to make a subdirectory of a file', t => { t.truthy(common.statFollowLinks('test/resources/file1').isFile()); const result = shell.mkdir('test/resources/file1/subdir'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mkdir: cannot create directory test/resources/file1/subdir: Not a directory'); t.truthy(common.statFollowLinks('test/resources/file1').isFile()); t.falsy(fs.existsSync('test/resources/file1/subdir')); }); test('Check for invalid permissions', t => { utils.skipOnWin(t, () => { // This test case only works on unix, but should work on Windows as well const dirName = 'nowritedir'; shell.mkdir(dirName); t.falsy(shell.error()); shell.chmod('-w', dirName); const result = shell.mkdir(dirName + '/foo'); t.is(result.code, 1); t.is( result.stderr, 'mkdir: cannot create directory nowritedir/foo: Permission denied' ); t.truthy(shell.error()); t.falsy(fs.existsSync(dirName + '/foo')); shell.rm('-rf', dirName); // clean up }); }); // // Valids // test('basic usage', t => { t.falsy(fs.existsSync(`${t.context.tmp}/t1`)); const result = shell.mkdir(`${t.context.tmp}/t1`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/t1`)); }); test('multiple dirs', t => { t.falsy(fs.existsSync(`${t.context.tmp}/t2`)); t.falsy(fs.existsSync(`${t.context.tmp}/t3`)); const result = shell.mkdir(`${t.context.tmp}/t2`, `${t.context.tmp}/t3`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/t2`)); t.truthy(fs.existsSync(`${t.context.tmp}/t3`)); }); test('one dir exists, the other does not', t => { shell.mkdir(`${t.context.tmp}/t1`); t.truthy(fs.existsSync(`${t.context.tmp}/t1`)); t.falsy(fs.existsSync(`${t.context.tmp}/t4`)); const result = shell.mkdir(`${t.context.tmp}/t1`, `${t.context.tmp}/t4`); t.is(result.code, 1); t.is(utils.numLines(shell.error()), 1); t.truthy(fs.existsSync(`${t.context.tmp}/t1`)); t.truthy(fs.existsSync(`${t.context.tmp}/t4`)); }); test('-p flag', t => { t.falsy(fs.existsSync(`${t.context.tmp}/a`)); const result = shell.mkdir('-p', `${t.context.tmp}/a/b/c`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); shell.rm('-Rf', `${t.context.tmp}/a`); // revert }); test('multiple dirs', t => { const result = shell.mkdir('-p', `${t.context.tmp}/zzza`, `${t.context.tmp}/zzzb`, `${t.context.tmp}/zzzc`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/zzza`)); t.truthy(fs.existsSync(`${t.context.tmp}/zzzb`)); t.truthy(fs.existsSync(`${t.context.tmp}/zzzc`)); }); test('multiple dirs, array syntax', t => { const result = shell.mkdir('-p', [`${t.context.tmp}/yyya`, `${t.context.tmp}/yyyb`, `${t.context.tmp}/yyyc`]); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/yyya`)); t.truthy(fs.existsSync(`${t.context.tmp}/yyyb`)); t.truthy(fs.existsSync(`${t.context.tmp}/yyyc`)); }); test('globbed dir', t => { let result = shell.mkdir('-p', `${t.context.tmp}/mydir`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/mydir`)); result = shell.mkdir('-p', `${t.context.tmp}/m*ir`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/mydir`)); t.falsy(fs.existsSync(`${t.context.tmp}/m*ir`)); // doesn't create literal name }); test('non-normalized paths are still ok with -p', t => { const result = shell.mkdir('-p', `${t.context.tmp}/asdf/../asdf/./`); t.falsy(shell.error()); t.is(result.code, 0); t.truthy(fs.existsSync(`${t.context.tmp}/asdf`)); }); node-shelljs-0.8.3/test/mv.js000066400000000000000000000151171342005425100160510ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; const CWD = process.cwd(); const numLines = utils.numLines; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); shell.cd(t.context.tmp); }); test.afterEach.always(t => { process.chdir(CWD); shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no args', t => { const result = shell.mv(); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: missing and/or '); }); test('one arg', t => { const result = shell.mv('file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: missing and/or '); }); test('option only', t => { const result = shell.mv('-f'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: missing and/or '); }); test('option not supported', t => { t.truthy(fs.existsSync('file1')); // precondition const result = shell.mv('-Z', 'file1', 'file1'); t.truthy(shell.error()); t.truthy(fs.existsSync('file1')); t.is(result.code, 1); t.is(result.stderr, 'mv: option not recognized: Z'); }); test('source does not exist', t => { const result = shell.mv('asdfasdf', '..'); t.truthy(shell.error()); t.is(numLines(shell.error()), 1); t.falsy(fs.existsSync('../asdfasdf')); t.is(result.code, 1); t.is(result.stderr, 'mv: no such file or directory: asdfasdf'); }); test('sources do not exist', t => { const result = shell.mv('asdfasdf1', 'asdfasdf2', '..'); t.truthy(shell.error()); t.is(numLines(shell.error()), 2); t.falsy(fs.existsSync('../asdfasdf1')); t.falsy(fs.existsSync('../asdfasdf2')); t.is(result.code, 1); t.is( result.stderr, 'mv: no such file or directory: asdfasdf1\nmv: no such file or directory: asdfasdf2' ); }); test('too many sources (dest is file)', t => { const result = shell.mv('asdfasdf1', 'asdfasdf2', 'file1'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: dest is not a directory (too many sources)'); }); test('-n is no-force/no-clobber', t => { const result = shell.mv('-n', 'file1', 'file2'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: dest file already exists: file2'); }); test('-n option with a directory as the destination', t => { shell.cp('file1', 'cp'); // copy it so we're sure it's already there const result = shell.mv('-n', 'file1', 'cp'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: dest file already exists: cp/file1'); }); test('-f is the default behavior', t => { const result = shell.mv('file1', 'file2'); // dest already exists (but that's ok) t.falsy(shell.error()); t.falsy(result.stderr); t.is(result.code, 0); }); test('-fn is the same as -n', t => { const result = shell.mv('-fn', 'file1', 'file2'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'mv: dest file already exists: file2'); }); test('too many sources (exist, but dest is file)', t => { const result = shell.mv('file1', 'file2', 'a_file'); t.truthy(shell.error()); t.falsy(fs.existsSync('a_file')); t.is(result.code, 1); t.is(result.stderr, 'mv: dest is not a directory (too many sources)'); }); test('can\'t use wildcard when dest is file', t => { const result = shell.mv('file*', 'file1'); t.truthy(shell.error()); t.truthy(fs.existsSync('file1')); t.truthy(fs.existsSync('file2')); t.truthy(fs.existsSync('file1.js')); t.truthy(fs.existsSync('file2.js')); t.is(result.code, 1); t.is(result.stderr, 'mv: dest is not a directory (too many sources)'); }); // // Valids // test('handles self OK', t => { const tmp2 = `${t.context.tmp}-2`; shell.mkdir(tmp2); let result = shell.mv('*', tmp2); // has to handle self (tmp2 --> tmp2) without throwing error t.truthy(shell.error()); // there's an error, but not fatal t.truthy(fs.existsSync(`${tmp2}/file1`)); // moved OK t.is(result.code, 1); result = shell.mv(`${tmp2}/*`, '.'); // revert t.truthy(fs.existsSync('file1')); // moved OK t.is(result.code, 0); }); test('one source', t => { let result = shell.mv('file1', 'file3'); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync('file1')); t.truthy(fs.existsSync('file3')); result = shell.mv('file3', 'file1'); // revert t.falsy(shell.error()); t.truthy(fs.existsSync('file1')); t.is(result.code, 0); }); test('two sources', t => { const result = shell.mv('file1', 'file2', 'cp'); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync('file1')); t.falsy(fs.existsSync('file2')); t.truthy(fs.existsSync('cp/file1')); t.truthy(fs.existsSync('cp/file2')); }); test('two sources, array style', t => { shell.rm('-rf', 't'); shell.mkdir('-p', 't'); let result = shell.mv(['file1', 'file2'], 't'); // two sources t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync('file1')); t.falsy(fs.existsSync('file2')); t.truthy(fs.existsSync('t/file1')); t.truthy(fs.existsSync('t/file2')); result = shell.mv('t/*', '.'); // revert t.truthy(fs.existsSync('file1')); t.truthy(fs.existsSync('file2')); }); test('wildcard', t => { shell.mkdir('-p', 't'); let result = shell.mv('file*.js', 't'); // wildcard t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync('file1.js')); t.falsy(fs.existsSync('file2.js')); t.truthy(fs.existsSync('t/file1.js')); t.truthy(fs.existsSync('t/file2.js')); result = shell.mv('t/*', '.'); // revert t.truthy(fs.existsSync('file1.js')); t.truthy(fs.existsSync('file2.js')); }); test('dest exists, but -f given', t => { const result = shell.mv('-f', 'file1', 'file2'); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync('file1')); t.truthy(fs.existsSync('file2')); }); test('should not overwrite recently created files', t => { shell.mkdir('-p', 't'); const result = shell.mv('file1', 'cp/file1', 't/'); t.truthy(shell.error()); t.is(result.code, 1); // Ensure First file is copied t.is(shell.cat('t/file1').toString(), 'test1'); t.is( result.stderr, "mv: will not overwrite just-created 't/file1' with 'cp/file1'" ); t.truthy(fs.existsSync('cp/file1')); }); test('should not overwrite recently created files (not give error no-force mode)', t => { shell.mkdir('-p', 't'); const result = shell.mv('-n', 'file1', 'cp/file1', 't/'); t.falsy(shell.error()); t.is(result.code, 0); // Ensure First file is moved t.is(shell.cat('t/file1').toString(), 'test1'); t.truthy(fs.existsSync('cp/file1')); }); node-shelljs-0.8.3/test/pipe.js000066400000000000000000000041211342005425100163550ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; shell.config.silent = true; // // Invalids // test('commands like `rm` cannot be on the right side of pipes', t => { t.is(shell.ls('.').rm, undefined); t.is(shell.cat('test/resources/file1.txt').rm, undefined); }); // // Valids // test('piping to cat() should return roughly the same thing', t => { t.is( shell.cat('test/resources/file1.txt').cat().toString(), shell.cat('test/resources/file1.txt').toString() ); }); test('piping ls() into cat() converts to a string-like object', t => { t.is(shell.ls('test/resources/').cat().toString(), shell.ls('test/resources/').stdout); }); test('grep works in a pipe', t => { const result = shell.ls('test/resources/').grep('file1'); t.is(result.toString(), 'file1\nfile1.js\nfile1.txt\n'); }); test('multiple pipes work', t => { const result = shell.ls('test/resources/').cat().grep('file1'); t.is(result.toString(), 'file1\nfile1.js\nfile1.txt\n'); }); test('Equivalent to a simple grep() test case', t => { const result = shell.cat('test/resources/grep/file').grep(/alpha*beta/); t.falsy(shell.error()); t.is(result.toString(), 'alphaaaaaaabeta\nalphbeta\n'); }); test('Equivalent to a simple sed() test case', t => { const result = shell.cat('test/resources/grep/file').sed(/l*\.js/, ''); t.falsy(shell.error()); t.is( result.toString(), 'alphaaaaaaabeta\nhowareyou\nalphbeta\nthis line ends in\n\n' ); }); test('Sort a file by frequency of each line', t => { const result = shell.sort('test/resources/uniq/pipe').uniq('-c').sort('-n'); t.falsy(shell.error()); t.is(result.toString(), shell.cat('test/resources/uniq/pipeSorted').toString()); }); test('Synchronous exec', t => { const result = shell.cat('test/resources/grep/file').exec('shx grep "alpha*beta"'); t.falsy(shell.error()); t.is(result.toString(), 'alphaaaaaaabeta\nalphbeta\n'); }); test.cb('Asynchronous exec', t => { shell.cat('test/resources/grep/file').exec('shx grep "alpha*beta"', (code, stdout) => { t.is(code, 0); t.is(stdout, 'alphaaaaaaabeta\nalphbeta\n'); t.end(); }); }); node-shelljs-0.8.3/test/plugin.js000066400000000000000000000077431342005425100167330ustar00rootroot00000000000000import test from 'ava'; // This is the supported order for importing these files import plugin from '../plugin'; import shell from '..'; let data = 0; let fname; function fooImplementation(options, arg) { // Some sort of side effect, so we know when this is called if (arg) { fname = arg; } else { fname = plugin.readFromPipe(); } if (arg === 'exitWithCode5') { plugin.error('Exited with code 5', 5); } else if (arg === 'changePrefix') { plugin.error('prefix was changed', { prefix: 'prefix: ', }); } else if (arg === 'continue') { plugin.error('Error, but continuing', { continue: true, }); } if (options.flag) { data = 12; } else { data++; } return 'hello world'; } test.beforeEach(() => { shell.config.resetForTesting(); }); // // Invalids // test('Unable to register a plugin with unknown options', t => { t.throws(() => { plugin.register('foo', fooImplementation, { foobar: true, }); }, Error); }); test('Unable to register a plugin with wrong option types', t => { t.throws(() => { plugin.register('foo', fooImplementation, { wrapOutput: 'true', // should be a boolean }); }, TypeError); }); // // Valids // test('All plugin utils exist', t => { t.is(typeof plugin.error, 'function'); t.is(typeof plugin.parseOptions, 'function'); t.is(typeof plugin.readFromPipe, 'function'); t.is(typeof plugin.register, 'function'); }); test('The plugin does not exist before it\'s registered', t => { t.falsy(shell.foo); }); test('Register the plugin', t => { plugin.register('foo', fooImplementation, { cmdOptions: { f: 'flag', }, wrapOutput: true, canReceivePipe: true, }); t.pass(); }); test('The plugin exists after registering', t => { t.is(typeof shell.foo, 'function'); }); test('The command fails for invalid options', t => { const result = shell.foo('-n', 'filename'); t.is(result.code, 1); t.is(result.stdout, ''); t.is(result.stderr, 'foo: option not recognized: n'); t.is(shell.error(), 'foo: option not recognized: n'); }); test('The command succeeds for normal calls', t => { t.is(data, 0); shell.foo('filename'); t.is(data, 1); t.is(fname, 'filename'); shell.foo('filename2'); t.is(data, 2); t.is(fname, 'filename2'); }); test('The command parses options', t => { shell.foo('-f', 'filename'); t.is(data, 12); t.is(fname, 'filename'); }); test('The command supports globbing by default', t => { shell.foo('-f', 'test/re*u?ces'); t.is(data, 12); t.is(fname, 'test/resources'); }); test('Plugins are also compatible with shelljs/global', t => { require('../global'); t.is(typeof global.foo, 'function'); t.is(global.foo, shell.foo); }); test('Plugins can be added as methods to ShellStrings', t => { const result = shell.ShellString('hello world\n'); t.is(result.toString(), 'hello world\n'); t.is(typeof result.grep, 'function'); // existing methods persist t.is(typeof result.foo, 'function'); result.foo(); t.is(fname, 'hello world\n'); // readFromPipe() works }); test('Plugins can signal errors', t => { const result = shell.foo('exitWithCode5'); t.is(result.code, 5); t.is(result.stdout, ''); t.is(result.stderr, 'foo: Exited with code 5'); t.is(shell.error(), 'foo: Exited with code 5'); }); test('Plugins can change the prefix', t => { const result = shell.foo('changePrefix'); t.is(result.code, 1); t.is(result.stdout, ''); t.is(result.stderr, 'prefix: prefix was changed'); t.is(shell.error(), 'prefix: prefix was changed'); }); test('Plugins can continue from errors', t => { const result = shell.foo('continue'); t.is(result.code, 1); t.is(result.stdout, 'hello world'); t.is(result.stderr, 'foo: Error, but continuing'); t.is(shell.error(), 'foo: Error, but continuing'); }); test('Cannot overwrite an existing command', t => { const oldCat = shell.cat; t.throws(() => { plugin.register('cat', fooImplementation); }, 'Command `cat` already exists'); t.is(shell.cat, oldCat); }); node-shelljs-0.8.3/test/popd.js000066400000000000000000000071231342005425100163670ustar00rootroot00000000000000import path from 'path'; import test from 'ava'; import shell from '..'; import mocks from './utils/mocks'; const rootDir = path.resolve(); function reset() { shell.dirs('-c'); shell.cd(rootDir); } test.beforeEach(() => { shell.config.resetForTesting(); reset(); }); test.after.always(() => { reset(); }); // // Valids // test('basic usage', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd(); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [rootDir]); }); test('two directories on the stack', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); const trail = shell.popd(); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('three directories on the stack', t => { shell.pushd('test/resources/pushd'); shell.pushd('b'); shell.pushd('c'); const trail = shell.popd(); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Valid by index', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd('+0'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [rootDir]); }); test('Using +1 option', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd('+1'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [path.resolve(rootDir, 'test/resources/pushd')]); }); test('Using -0 option', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd('-0'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [path.resolve(rootDir, 'test/resources/pushd')]); }); test('Using -1 option', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd('-1'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [rootDir]); }); test('Using -n option', t => { shell.pushd('test/resources/pushd'); const trail = shell.popd('-n'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [path.resolve(rootDir, 'test/resources/pushd')]); }); test('Popping an empty stack', t => { shell.popd(); t.truthy(shell.error('popd: directory stack empty\n')); }); test('Test that rootDir is not stored', t => { shell.cd('test/resources/pushd'); shell.pushd('b'); const trail = shell.popd(); t.falsy(shell.error()); t.is(trail[0], path.resolve(rootDir, 'test/resources/pushd')); t.is(process.cwd(), trail[0]); shell.popd(); // no more in the stack t.truthy(shell.error()); }); test('quiet mode off', t => { try { shell.pushd('test/resources/pushd'); shell.config.silent = false; mocks.init(); const trail = shell.popd(); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, ''); t.is(stderr, `${rootDir}\n`); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [rootDir]); } finally { shell.config.silent = true; mocks.restore(); } }); test('quiet mode on', t => { try { shell.pushd('test/resources/pushd'); shell.config.silent = false; mocks.init(); const trail = shell.popd('-q'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, ''); t.is(stderr, ''); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [rootDir]); } finally { shell.config.silent = true; mocks.restore(); } }); node-shelljs-0.8.3/test/pushd.js000066400000000000000000000237171342005425100165570ustar00rootroot00000000000000import path from 'path'; import test from 'ava'; import shell from '..'; import mocks from './utils/mocks'; const rootDir = path.resolve(); function reset() { shell.dirs('-c'); shell.cd(rootDir); } test.beforeEach(() => { shell.config.resetForTesting(); reset(); }); test.after.always(() => { reset(); }); // // Valids // test('Push valid directories', t => { const trail = shell.pushd('test/resources/pushd'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Two directories', t => { shell.pushd('test/resources/pushd'); const trail = shell.pushd('a'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Three directories', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); const trail = shell.pushd('../b'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Four directories', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); const trail = shell.pushd('c'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Push stuff around with positive indices', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('+0'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('+1 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('+1'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), ]); }); test('+2 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('+2'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), ]); }); test('+3 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('+3'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), ]); }); test('+4 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('+4'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), ]); }); test('Push stuff around with negative indices', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('-0'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), ]); }); test('-1 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('-1'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), ]); }); test('-2 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('-2'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), ]); }); test('-3 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('-3'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, path.resolve(rootDir, 'test/resources/pushd/b/c'), ]); }); test('-4 option', t => { shell.pushd('test/resources/pushd'); shell.pushd('a'); shell.pushd('../b'); shell.pushd('c'); const trail = shell.pushd('-4'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd/b/c'), path.resolve(rootDir, 'test/resources/pushd/b'), path.resolve(rootDir, 'test/resources/pushd/a'), path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); }); test('Push without changing directory or resolving paths', t => { const trail = shell.pushd('-n', 'test/resources/pushd'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ rootDir, 'test/resources/pushd', ]); }); test('Using the -n option with a non-empty stack', t => { shell.pushd('-n', 'test/resources/pushd'); const trail = shell.pushd('-n', 'test/resources/pushd/a'); t.falsy(shell.error()); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ rootDir, 'test/resources/pushd/a', 'test/resources/pushd', ]); }); test('Push invalid directory', t => { const oldCwd = process.cwd(); shell.pushd('does/not/exist'); t.is( shell.error(), `pushd: no such file or directory: ${path.resolve('.', 'does/not/exist') .replace(/\\/g, '/')}` ); t.is(process.cwd(), oldCwd); }); test( 'Push without args swaps top two directories when stack length is 2', t => { let trail = shell.pushd('test/resources/pushd'); t.falsy(shell.error()); t.is(trail.length, 2); t.is(path.relative(rootDir, trail[0]), path.join('test/resources', 'pushd')); t.is(trail[1], rootDir); t.is(process.cwd(), trail[0]); trail = shell.pushd(); t.falsy(shell.error()); t.is(trail.length, 2); t.is(trail[0], rootDir); t.is(path.relative(rootDir, trail[1]), path.join('test/resources', 'pushd')); t.is(process.cwd(), trail[0]); } ); test( 'Push without args swaps top two directories for larger stacks', t => { shell.pushd('test/resources/pushd'); shell.pushd(); const trail = shell.pushd('test/resources/pushd/a'); t.falsy(shell.error()); t.is(trail.length, 3); t.is(path.relative(rootDir, trail[0]), path.join('test/resources', 'pushd', 'a')); t.is(trail[1], rootDir); t.is(path.relative(rootDir, trail[2]), path.join('test/resources', 'pushd')); t.is(process.cwd(), trail[0]); } ); test('Pushing with no args', t => { shell.pushd('-n', 'test/resources/pushd'); shell.pushd('test/resources/pushd/a'); const trail = shell.pushd(); t.falsy(shell.error()); t.is(trail.length, 3); t.is(trail[0], rootDir); t.is(path.relative(rootDir, trail[1]), path.join('test/resources', 'pushd', 'a')); t.is(path.relative(rootDir, trail[2]), path.join('test/resources', 'pushd')); t.is(process.cwd(), trail[0]); }); test('Push without arguments invalid when stack is empty', t => { shell.pushd(); t.is(shell.error(), 'pushd: no other directory'); }); test('quiet mode off', t => { try { shell.config.silent = false; mocks.init(); const trail = shell.pushd('test/resources/pushd'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, ''); t.is(stderr, `${path.resolve(rootDir, 'test/resources/pushd')} ${rootDir}\n`); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); } finally { shell.config.silent = true; mocks.restore(); } }); test('quiet mode on', t => { try { shell.config.silent = false; mocks.init(); const trail = shell.pushd('-q', 'test/resources/pushd'); const stdout = mocks.stdout(); const stderr = mocks.stderr(); t.falsy(shell.error()); t.is(stdout, ''); t.is(stderr, ''); t.is(process.cwd(), trail[0]); t.deepEqual(trail, [ path.resolve(rootDir, 'test/resources/pushd'), rootDir, ]); } finally { shell.config.silent = true; mocks.restore(); } }); node-shelljs-0.8.3/test/pwd.js000066400000000000000000000014111342005425100162110ustar00rootroot00000000000000import path from 'path'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; const cur = process.cwd(); test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { process.chdir(cur); shell.rm('-rf', t.context.tmp); }); // // Valids // test('initial directory', t => { const cwd = shell.pwd(); t.falsy(shell.error()); t.is(cwd.code, 0); t.falsy(cwd.stderr); t.is(cwd.toString(), path.resolve('.')); }); test('after changing directory', t => { shell.cd(t.context.tmp); const cwd = shell.pwd(); t.is(cwd.code, 0); t.falsy(cwd.stderr); t.falsy(shell.error()); t.is(path.basename(cwd.toString()), t.context.tmp); }); node-shelljs-0.8.3/test/resources/000077500000000000000000000000001342005425100170765ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/a.txt000066400000000000000000000001441342005425100200560ustar00rootroot00000000000000This is line one This is line two This is line four . . More content here . . This is line eleven node-shelljs-0.8.3/test/resources/badlink000077700000000000000000000000001342005425100236672not_existed_fileustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cat/000077500000000000000000000000001342005425100176455ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cat/file1000066400000000000000000000000061342005425100205640ustar00rootroot00000000000000test1 node-shelljs-0.8.3/test/resources/cat/file2000066400000000000000000000000061342005425100205650ustar00rootroot00000000000000test2 node-shelljs-0.8.3/test/resources/cat/file3000066400000000000000000000000051342005425100205650ustar00rootroot00000000000000test3node-shelljs-0.8.3/test/resources/cat/file4000066400000000000000000000001541342005425100205730ustar00rootroot00000000000000test4-01 test4-02 test4-03 test4-04 test4-05 test4-06 test4-07 test4-08 test4-09 test4-10 test4-11 test4-12 node-shelljs-0.8.3/test/resources/cat/file5000066400000000000000000000000001342005425100205620ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/000077500000000000000000000000001342005425100201705ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/a/000077500000000000000000000000001342005425100204105ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/a/b/000077500000000000000000000000001342005425100206315ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/a/b/c/000077500000000000000000000000001342005425100210535ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/a/b/c/.gitignore000066400000000000000000000000001342005425100230310ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/b/000077500000000000000000000000001342005425100204115ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/b/a/000077500000000000000000000000001342005425100206315ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/b/a/b/000077500000000000000000000000001342005425100210525ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/b/a/b/.gitignore000077500000000000000000000000001342005425100230330ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/c/000077500000000000000000000000001342005425100204125ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/c/a/000077500000000000000000000000001342005425100206325ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/c/a/b/000077500000000000000000000000001342005425100210535ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/c/a/b/.gitignore000066400000000000000000000000001342005425100230310ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/file1000066400000000000000000000000751342005425100211150ustar00rootroot00000000000000this is test file 1 default state should be 0644 (rw-r--r--) node-shelljs-0.8.3/test/resources/chmod/xdir/000077500000000000000000000000001342005425100211365ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/xdir/deep/000077500000000000000000000000001342005425100220535ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/chmod/xdir/deep/file000066400000000000000000000000071342005425100227120ustar00rootroot00000000000000a file node-shelljs-0.8.3/test/resources/chmod/xdir/file000066400000000000000000000000071342005425100217750ustar00rootroot00000000000000a file node-shelljs-0.8.3/test/resources/cp-mode-bits/000077500000000000000000000000001342005425100213615ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp-mode-bits/executable000077500000000000000000000000041342005425100234220ustar00rootroot00000000000000asdfnode-shelljs-0.8.3/test/resources/cp/000077500000000000000000000000001342005425100175005ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/a000066400000000000000000000000051342005425100176360ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/cp/b000066400000000000000000000000051342005425100176370ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/cp/dir_a/000077500000000000000000000000001342005425100205565ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/dir_a/z000066400000000000000000000000051342005425100207450ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/cp/dir_b/000077500000000000000000000000001342005425100205575ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/dir_b/dir_b_a/000077500000000000000000000000001342005425100221365ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/000077500000000000000000000000001342005425100240155ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z000066400000000000000000000000051342005425100242040ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/cp/fakeLinks/000077500000000000000000000000001342005425100214075ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/fakeLinks/file.txt000066400000000000000000000000171342005425100230650ustar00rootroot00000000000000This is a file node-shelljs-0.8.3/test/resources/cp/fakeLinks/sym.lnk000066400000000000000000000000231342005425100227200ustar00rootroot00000000000000This is not a link node-shelljs-0.8.3/test/resources/cp/file1000066400000000000000000000000061342005425100204170ustar00rootroot00000000000000test2 node-shelljs-0.8.3/test/resources/cp/links/000077500000000000000000000000001342005425100206205ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/links/file.txt000066400000000000000000000000171342005425100222760ustar00rootroot00000000000000This is a file node-shelljs-0.8.3/test/resources/cp/links/sym.lnk000077700000000000000000000000001342005425100236112file.txtustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/cp/symFolder000077700000000000000000000000001342005425100225042links/ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/exec/000077500000000000000000000000001342005425100200225ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/exec/slow.js000066400000000000000000000001501342005425100213400ustar00rootroot00000000000000#!/usr/bin/env node setTimeout(function() { console.log('slow'); }, parseInt(process.argv[2], 10)); node-shelljs-0.8.3/test/resources/external/000077500000000000000000000000001342005425100207205ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/external/node_script.js000077500000000000000000000000421342005425100235660ustar00rootroot00000000000000console.log('node_script_1234'); node-shelljs-0.8.3/test/resources/file1000066400000000000000000000000051342005425100200140ustar00rootroot00000000000000test1node-shelljs-0.8.3/test/resources/file1.js000066400000000000000000000000051342005425100204270ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/file1.txt000066400000000000000000000000061342005425100206330ustar00rootroot00000000000000test1 node-shelljs-0.8.3/test/resources/file2000066400000000000000000000000051342005425100200150ustar00rootroot00000000000000test2node-shelljs-0.8.3/test/resources/file2.js000066400000000000000000000000051342005425100204300ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/file2.txt000066400000000000000000000000061342005425100206340ustar00rootroot00000000000000test2 node-shelljs-0.8.3/test/resources/find/000077500000000000000000000000001342005425100200165ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/find/.hidden000066400000000000000000000000051342005425100212450ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/find/a000066400000000000000000000000051342005425100201540ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/find/b000066400000000000000000000000051342005425100201550ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/find/broken_link000077700000000000000000000000001342005425100246712non_existentustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/find/dir1/000077500000000000000000000000001342005425100206555ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/find/dir1/a_dir1000066400000000000000000000000051342005425100217320ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/find/dir1/dir11/000077500000000000000000000000001342005425100215755ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/find/dir1/dir11/a_dir11000066400000000000000000000000051342005425100227330ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/find/dir2/000077500000000000000000000000001342005425100206565ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/find/dir2/a_dir1000066400000000000000000000000051342005425100217330ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/grep/000077500000000000000000000000001342005425100200335ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/grep/case1000066400000000000000000000000061342005425100207460ustar00rootroot00000000000000Test3 node-shelljs-0.8.3/test/resources/grep/case1.js000066400000000000000000000000061342005425100213610ustar00rootroot00000000000000test3 node-shelljs-0.8.3/test/resources/grep/case1.txt000066400000000000000000000000061342005425100215640ustar00rootroot00000000000000TEST3 node-shelljs-0.8.3/test/resources/grep/file000066400000000000000000000001151342005425100206720ustar00rootroot00000000000000alphaaaaaaabeta howareyou alphbeta this line ends in.js lllllllllllllllll.js node-shelljs-0.8.3/test/resources/grep/file2000066400000000000000000000000121342005425100207500ustar00rootroot00000000000000-v -vv -a node-shelljs-0.8.3/test/resources/head/000077500000000000000000000000001342005425100177775ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/head/file1.txt000066400000000000000000000006711342005425100215440ustar00rootroot00000000000000file1 1 file1 2 file1 3 file1 4 file1 5 file1 6 file1 7 file1 8 file1 9 file1 10 file1 11 file1 12 file1 13 file1 14 file1 15 file1 16 file1 17 file1 18 file1 19 file1 20 file1 21 file1 22 file1 23 file1 24 file1 25 file1 26 file1 27 file1 28 file1 29 file1 30 file1 31 file1 32 file1 33 file1 34 file1 35 file1 36 file1 37 file1 38 file1 39 file1 40 file1 41 file1 42 file1 43 file1 44 file1 45 file1 46 file1 47 file1 48 file1 49 file1 50 node-shelljs-0.8.3/test/resources/head/file2.txt000066400000000000000000000006711342005425100215450ustar00rootroot00000000000000file2 1 file2 2 file2 3 file2 4 file2 5 file2 6 file2 7 file2 8 file2 9 file2 10 file2 11 file2 12 file2 13 file2 14 file2 15 file2 16 file2 17 file2 18 file2 19 file2 20 file2 21 file2 22 file2 23 file2 24 file2 25 file2 26 file2 27 file2 28 file2 29 file2 30 file2 31 file2 32 file2 33 file2 34 file2 35 file2 36 file2 37 file2 38 file2 39 file2 40 file2 41 file2 42 file2 43 file2 44 file2 45 file2 46 file2 47 file2 48 file2 49 file2 50 node-shelljs-0.8.3/test/resources/head/shortfile1000066400000000000000000000000071342005425100217770ustar00rootroot00000000000000short1 node-shelljs-0.8.3/test/resources/head/shortfile2000066400000000000000000000000071342005425100220000ustar00rootroot00000000000000short2 node-shelljs-0.8.3/test/resources/issue44/000077500000000000000000000000001342005425100203765ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/issue44/main.js000066400000000000000000000000031342005425100216510ustar00rootroot00000000000000123node-shelljs-0.8.3/test/resources/link000077700000000000000000000000001342005425100206742file1ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/000077500000000000000000000000001342005425100175145ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/.hidden_dir/000077500000000000000000000000001342005425100216635ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/.hidden_dir/nada000066400000000000000000000000051342005425100225040ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/ls/.hidden_file000066400000000000000000000000051342005425100217420ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/ls/a_dir/000077500000000000000000000000001342005425100205725ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/a_dir/.hidden_dir/000077500000000000000000000000001342005425100227415ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/a_dir/.hidden_dir/nada000066400000000000000000000000041342005425100235610ustar00rootroot00000000000000nadanode-shelljs-0.8.3/test/resources/ls/a_dir/b_dir/000077500000000000000000000000001342005425100216515ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/ls/a_dir/b_dir/z000066400000000000000000000000051342005425100220400ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/ls/a_dir/nada000066400000000000000000000000051342005425100214130ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/ls/file1000066400000000000000000000000051342005425100204320ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/ls/file1.js000066400000000000000000000000051342005425100210450ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/ls/file2000066400000000000000000000000051342005425100204330ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/ls/file2.js000066400000000000000000000000051342005425100210460ustar00rootroot00000000000000test node-shelljs-0.8.3/test/resources/ls/filename(with)[chars$]^that.must+be-escaped000066400000000000000000000000051342005425100275760ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/pushd/000077500000000000000000000000001342005425100202215ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/pushd/a/000077500000000000000000000000001342005425100204415ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/pushd/a/dummy000066400000000000000000000000031342005425100215100ustar00rootroot00000000000000mehnode-shelljs-0.8.3/test/resources/pushd/b/000077500000000000000000000000001342005425100204425ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/pushd/b/c/000077500000000000000000000000001342005425100206645ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/pushd/b/c/dummy000066400000000000000000000000031342005425100217330ustar00rootroot00000000000000mehnode-shelljs-0.8.3/test/resources/rm/000077500000000000000000000000001342005425100175145ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/rm/a_dir/000077500000000000000000000000001342005425100205725ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/rm/a_dir/a_file000066400000000000000000000000051342005425100217270ustar00rootroot00000000000000asdf node-shelljs-0.8.3/test/resources/rm/fake.lnk000077700000000000000000000000001342005425100225172missingustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/rm/link_to_a_dir000077700000000000000000000000001342005425100232302a_dirustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/sed/000077500000000000000000000000001342005425100176515ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/sed/empty.txt000066400000000000000000000000001342005425100215360ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/shjs/000077500000000000000000000000001342005425100200455ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/shjs/a-file.js000066400000000000000000000000451342005425100215370ustar00rootroot00000000000000console.log('OK!'); process.exit(0); node-shelljs-0.8.3/test/resources/shjs/coffeescript.coffee000066400000000000000000000000521342005425100236670ustar00rootroot00000000000000msg = 'CoffeeScript: OK!' console.log msg node-shelljs-0.8.3/test/resources/shjs/exit-0.js000066400000000000000000000000211342005425100215020ustar00rootroot00000000000000process.exit(0); node-shelljs-0.8.3/test/resources/shjs/exit-codes.js000066400000000000000000000000221342005425100224410ustar00rootroot00000000000000process.exit(42); node-shelljs-0.8.3/test/resources/shjs/stdout-stderr.js000066400000000000000000000000721342005425100232250ustar00rootroot00000000000000console.log('stdout: OK!'); console.error('stderr: OK!'); node-shelljs-0.8.3/test/resources/sort/000077500000000000000000000000001342005425100200655ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/sort/file1000066400000000000000000000001421342005425100210050ustar00rootroot0000000000000022 symbolic 46 integers melt admiral aardvark scanner Dynamite Witness 12345 blackwater 5 numbers node-shelljs-0.8.3/test/resources/sort/file2000066400000000000000000000001421342005425100210060ustar00rootroot00000000000000admiral scanner 5 numbers Witness 46 integers 12345 Dynamite blackwater aardvark 22 symbolic melt node-shelljs-0.8.3/test/resources/sort/sorted000066400000000000000000000001421342005425100213050ustar00rootroot0000000000000012345 22 46 integers 5 numbers aardvark admiral blackwater Dynamite melt scanner symbolic Witness node-shelljs-0.8.3/test/resources/sort/sortedDashN000066400000000000000000000001421342005425100222230ustar00rootroot00000000000000aardvark admiral blackwater Dynamite melt scanner symbolic Witness 5 numbers 22 46 integers 12345 node-shelljs-0.8.3/test/resources/uniq/000077500000000000000000000000001342005425100200525ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/uniq/file1000066400000000000000000000000201342005425100207650ustar00rootroot00000000000000foo bar bar baz node-shelljs-0.8.3/test/resources/uniq/file1c000066400000000000000000000000441342005425100211360ustar00rootroot00000000000000 1 foo 2 bar 1 baz node-shelljs-0.8.3/test/resources/uniq/file1d000066400000000000000000000000041342005425100211330ustar00rootroot00000000000000bar node-shelljs-0.8.3/test/resources/uniq/file1t000066400000000000000000000000141342005425100211540ustar00rootroot00000000000000foo bar baz node-shelljs-0.8.3/test/resources/uniq/file1u000066400000000000000000000000141342005425100211550ustar00rootroot00000000000000foo bar baz node-shelljs-0.8.3/test/resources/uniq/file2000066400000000000000000000000201342005425100207660ustar00rootroot00000000000000foo bar Bar baz node-shelljs-0.8.3/test/resources/uniq/file2u000066400000000000000000000000141342005425100211560ustar00rootroot00000000000000foo bar baz node-shelljs-0.8.3/test/resources/uniq/file3000066400000000000000000000000141342005425100207720ustar00rootroot00000000000000foo bar baz node-shelljs-0.8.3/test/resources/uniq/pipe000066400000000000000000000003101342005425100207240ustar00rootroot00000000000000bar foo foo baz foo foo bar foo baz baz foo baz baz baz bar baz bar bar baz bar baz foo baz foo baz foo bar baz bar bar bar foo foo foo foo baz foo baz foo foo bar foo foo bar foo foo baz foo foo foo node-shelljs-0.8.3/test/resources/uniq/pipeSorted000066400000000000000000000000441342005425100221110ustar00rootroot00000000000000 12 bar 15 baz 23 foo node-shelljs-0.8.3/test/resources/which/000077500000000000000000000000001342005425100202005ustar00rootroot00000000000000node-shelljs-0.8.3/test/resources/which/node000066400000000000000000000000351342005425100210460ustar00rootroot00000000000000text file, not an executable node-shelljs-0.8.3/test/rm.js000066400000000000000000000252151342005425100160450ustar00rootroot00000000000000import fs from 'fs'; import path from 'path'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no args', t => { const result = shell.rm(); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'rm: no paths given'); }); test('file does not exist', t => { const result = shell.rm('asdfasdf'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'rm: no such file or directory: asdfasdf'); }); test('cannot delete a directoy without recursive flag', t => { const result = shell.rm(`${t.context.tmp}/rm`); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'rm: path is a directory'); }); test('only an option', t => { const result = shell.rm('-f'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'rm: no paths given'); }); test('invalid option', t => { const result = shell.rm('-@', 'test/resources/file1'); t.truthy(shell.error()); t.is(result.code, 1); t.truthy(fs.existsSync('test/resources/file1')); t.is(result.stderr, 'rm: option not recognized: @'); }); // // Valids // test('file does not exist, but -f specified', t => { const result = shell.rm('-f', 'asdfasdf'); t.falsy(shell.error()); t.is(result.code, 0); }); test('directory does not exist, but -fr specified', t => { const result = shell.rm('-fr', 'fake_dir/'); t.falsy(shell.error()); t.is(result.code, 0); }); test('directory does not exist, but *only -f* specified', t => { const result = shell.rm('-f', 'fake_dir/'); t.falsy(shell.error()); t.is(result.code, 0); }); test('file (in fake dir) does not exist, but -f specified', t => { const result = shell.rm('-f', 'fake_dir/asdfasdf'); t.falsy(shell.error()); t.is(result.code, 0); }); test('dir (in fake dir) does not exist, but -fr specified', t => { const result = shell.rm('-fr', 'fake_dir/sub/'); t.falsy(shell.error()); t.is(result.code, 0); }); test('simple rm', t => { t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); const result = shell.rm(`${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); }); test('recursive dir removal: -r option', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); const result = shell.rm('-rf', `${t.context.tmp}/a`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/a`)); }); test('-R option does the same thing', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); const result = shell.rm('-Rf', `${t.context.tmp}/a`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/a`)); }); test('recursive dir removal - absolute path', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); const result = shell.rm('-Rf', path.resolve(`./${t.context.tmp}/a`)); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/a`)); }); test('wildcard', t => { const result = shell.rm(`${t.context.tmp}/file*`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/file1`)); t.falsy(fs.existsSync(`${t.context.tmp}/file2`)); t.falsy(fs.existsSync(`${t.context.tmp}/file1.js`)); t.falsy(fs.existsSync(`${t.context.tmp}/file2.js`)); }); test('recursive dir removal', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); shell.mkdir('-p', `${t.context.tmp}/b`); shell.mkdir('-p', `${t.context.tmp}/c`); shell.mkdir('-p', `${t.context.tmp}/.hidden`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/b`)); t.truthy(fs.existsSync(`${t.context.tmp}/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/.hidden`)); const result = shell.rm('-rf', `${t.context.tmp}/*`); t.falsy(shell.error()); t.is(result.code, 0); const contents = fs.readdirSync(t.context.tmp); t.is(contents.length, 1); t.is(contents[0], '.hidden'); // shouldn't remove hidden if no .* given }); test('recursive dir removal #2', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); shell.mkdir('-p', `${t.context.tmp}/b`); shell.mkdir('-p', `${t.context.tmp}/c`); shell.mkdir('-p', `${t.context.tmp}/.hidden`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/b`)); t.truthy(fs.existsSync(`${t.context.tmp}/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/.hidden`)); const result = shell.rm('-rf', `${t.context.tmp}/*`, `${t.context.tmp}/.*`); t.falsy(shell.error()); t.is(result.code, 0); const contents = fs.readdirSync(t.context.tmp); t.is(contents.length, 0); }); test('recursive dir removal - array-syntax', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); shell.mkdir('-p', `${t.context.tmp}/b`); shell.mkdir('-p', `${t.context.tmp}/c`); shell.mkdir('-p', `${t.context.tmp}/.hidden`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/b`)); t.truthy(fs.existsSync(`${t.context.tmp}/c`)); t.truthy(fs.existsSync(`${t.context.tmp}/.hidden`)); const result = shell.rm('-rf', [`${t.context.tmp}/*`, `${t.context.tmp}/.*`]); t.falsy(shell.error()); t.is(result.code, 0); const contents = fs.readdirSync(t.context.tmp); t.is(contents.length, 0); }); test('removal of a read-only file (unforced)', t => { shell.mkdir('-p', `${t.context.tmp}/readonly`); shell.ShellString('asdf').to(`${t.context.tmp}/readonly/file1`); fs.chmodSync(`${t.context.tmp}/readonly/file1`, '0444'); // -r--r--r-- shell.rm(`${t.context.tmp}/readonly/file1`); t.truthy(shell.error()); t.truthy(fs.existsSync(`${t.context.tmp}/readonly/file1`)); // bash's rm always asks before removing read-only files // here we just assume "no" }); test('removal of a read-only file (forced)', t => { shell.mkdir('-p', `${t.context.tmp}/readonly`); shell.ShellString('asdf').to(`${t.context.tmp}/readonly/file2`); fs.chmodSync(`${t.context.tmp}/readonly/file2`, '0444'); // -r--r--r-- shell.rm('-f', `${t.context.tmp}/readonly/file2`); t.falsy(shell.error()); t.falsy(fs.existsSync(`${t.context.tmp}/readonly/file2`)); }); test('removal of a tree containing read-only files (unforced)', t => { shell.mkdir('-p', `${t.context.tmp}/tree2`); shell.ShellString('asdf').to(`${t.context.tmp}/tree2/file1`); shell.ShellString('asdf').to(`${t.context.tmp}/tree2/file2`); fs.chmodSync(`${t.context.tmp}/tree2/file1`, '0444'); // -r--r--r-- shell.rm('-r', `${t.context.tmp}/tree2`); t.truthy(shell.error()); t.truthy(fs.existsSync(`${t.context.tmp}/tree2/file1`)); t.falsy(fs.existsSync(`${t.context.tmp}/tree2/file2`)); }); test('removal of a tree containing read-only files (forced)', t => { shell.mkdir('-p', `${t.context.tmp}/tree`); shell.ShellString('asdf').to(`${t.context.tmp}/tree/file1`); shell.ShellString('asdf').to(`${t.context.tmp}/tree/file2`); fs.chmodSync(`${t.context.tmp}/tree/file1`, '0444'); // -r--r--r-- shell.rm('-rf', `${t.context.tmp}/tree`); t.falsy(shell.error()); t.falsy(fs.existsSync(`${t.context.tmp}/tree`)); }); test( 'removal of a sub-tree containing read-only and hidden files - glob', t => { shell.mkdir('-p', `${t.context.tmp}/tree3`); shell.mkdir('-p', `${t.context.tmp}/tree3/subtree`); shell.mkdir('-p', `${t.context.tmp}/tree3/.hidden`); shell.ShellString('asdf').to(`${t.context.tmp}/tree3/subtree/file`); shell.ShellString('asdf').to(`${t.context.tmp}/tree3/.hidden/file`); shell.ShellString('asdf').to(`${t.context.tmp}/tree3/file`); fs.chmodSync(`${t.context.tmp}/tree3/file`, '0444'); // -r--r--r-- fs.chmodSync(`${t.context.tmp}/tree3/subtree/file`, '0444'); // -r--r--r-- fs.chmodSync(`${t.context.tmp}/tree3/.hidden/file`, '0444'); // -r--r--r-- shell.rm('-rf', `${t.context.tmp}/tree3/*`, `${t.context.tmp}/tree3/.*`); // erase dir contents t.is(shell.ls(`${t.context.tmp}/tree3`).length, 0); } ); test( 'removal of a sub-tree containing read-only and hidden files - without glob', t => { shell.mkdir('-p', `${t.context.tmp}/tree4`); shell.mkdir('-p', `${t.context.tmp}/tree4/subtree`); shell.mkdir('-p', `${t.context.tmp}/tree4/.hidden`); shell.ShellString('asdf').to(`${t.context.tmp}/tree4/subtree/file`); shell.ShellString('asdf').to(`${t.context.tmp}/tree4/.hidden/file`); shell.ShellString('asdf').to(`${t.context.tmp}/tree4/file`); fs.chmodSync(`${t.context.tmp}/tree4/file`, '0444'); // -r--r--r-- fs.chmodSync(`${t.context.tmp}/tree4/subtree/file`, '0444'); // -r--r--r-- fs.chmodSync(`${t.context.tmp}/tree4/.hidden/file`, '0444'); // -r--r--r-- shell.rm('-rf', `${t.context.tmp}/tree4`); // erase dir contents t.falsy(fs.existsSync(`${t.context.tmp}/tree4`)); } ); test('remove symbolic link to a dir', t => { const result = shell.rm(`${t.context.tmp}/rm/link_to_a_dir`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/rm/link_to_a_dir`)); t.truthy(fs.existsSync(`${t.context.tmp}/rm/a_dir`)); }); test('rm -rf on a symbolic link to a dir deletes its contents', t => { utils.skipOnWin(t, () => { const result = shell.rm('-rf', `${t.context.tmp}/rm/link_to_a_dir/`); t.falsy(shell.error()); t.is(result.code, 0); // Both the link and original dir should remain, but contents are deleted t.truthy(fs.existsSync(`${t.context.tmp}/rm/link_to_a_dir`)); t.truthy(fs.existsSync(`${t.context.tmp}/rm/a_dir`)); t.falsy(fs.existsSync(`${t.context.tmp}/rm/a_dir/a_file`)); }); }); test('remove broken symbolic link', t => { utils.skipOnWin(t, () => { t.truthy(shell.test('-L', `${t.context.tmp}/rm/fake.lnk`)); const result = shell.rm(`${t.context.tmp}/rm/fake.lnk`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(shell.test('-L', `${t.context.tmp}/rm/fake.lnk`)); t.falsy(fs.existsSync(`${t.context.tmp}/rm/fake.lnk`)); }); }); test('recursive dir removal, for non-normalized path', t => { shell.mkdir('-p', `${t.context.tmp}/a/b/c`); t.truthy(fs.existsSync(`${t.context.tmp}/a/b/c`)); const result = shell.rm('-rf', `${t.context.tmp}/a/.././a`); t.falsy(shell.error()); t.is(result.code, 0); t.falsy(fs.existsSync(`${t.context.tmp}/a`)); }); test('remove fifo', t => { utils.skipOnWin(t, () => { const fifo = utils.mkfifo(t.context.tmp); const result = shell.rm(fifo); t.falsy(shell.error()); t.is(result.code, 0); }); }); node-shelljs-0.8.3/test/sed.js000066400000000000000000000124761342005425100162070ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('no arguments', t => { const result = shell.sed(); t.truthy(shell.error()); t.is(result.code, 1); t.truthy(result.stderr); }); test('only one argument', t => { const result = shell.sed(/asdf/g); t.truthy(shell.error()); t.is(result.code, 1); }); test('only two arguments', t => { const result = shell.sed(/asdf/g, 'nada'); t.truthy(shell.error()); t.is(result.code, 1); }); test('no such file', t => { t.falsy(fs.existsSync('asdfasdf')); // sanity check const result = shell.sed(/asdf/g, 'nada', 'asdfasdf'); t.truthy(shell.error()); t.is(result.code, 2); t.is(result.stderr, 'sed: no such file or directory: asdfasdf'); }); // TODO(nate): flaky test test('if at least one file is missing, this should be an error', t => { t.falsy(fs.existsSync('asdfasdf')); // sanity check t.truthy(fs.existsSync(`${t.context.tmp}/file1`)); // sanity check const result = shell.sed(/asdf/g, 'nada', `${t.context.tmp}/file1`, 'asdfasdf'); t.truthy(shell.error()); t.is(result.code, 2); t.is(result.stderr, 'sed: no such file or directory: asdfasdf'); }); // // Valids // test('search with a string', t => { const result = shell.sed('test1', 'hello', `${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello'); }); test('search with a regex', t => { const result = shell.sed(/test1/, 'hello', `${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello'); }); test('replace with a number instead of a string', t => { const result = shell.sed(/test1/, 1234, `${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), '1234'); }); test('replace using a function', t => { const replaceFun = match => match.toUpperCase() + match; const result = shell.sed(/test1/, replaceFun, `${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'TEST1test1'); }); test('-i option', t => { const result = shell.sed('-i', /test1/, 'hello', `${t.context.tmp}/file1`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello'); t.is(shell.cat(`${t.context.tmp}/file1`).toString(), 'hello'); }); test('make sure * in regex is not globbed', t => { const result = shell.sed(/alpha*beta/, 'hello', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.code, 0); t.is( result.toString(), 'hello\nhowareyou\nhello\nthis line ends in.js\nlllllllllllllllll.js\n' ); }); test('make sure * in string-regex is not globbed', t => { const result = shell.sed('alpha*beta', 'hello', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.code, 0); t.is( result.toString(), 'hello\nhowareyou\nhello\nthis line ends in.js\nlllllllllllllllll.js\n' ); }); test('make sure * in regex is not globbed (matches something)', t => { const result = shell.sed(/l*\.js/, '', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.code, 0); t.is( result.toString(), 'alphaaaaaaabeta\nhowareyou\nalphbeta\nthis line ends in\n\n' ); }); test('make sure * in string-regex is not globbed (matches something)', t => { const result = shell.sed('l*\\.js', '', 'test/resources/grep/file'); t.falsy(shell.error()); t.is(result.code, 0); t.is( result.toString(), 'alphaaaaaaabeta\nhowareyou\nalphbeta\nthis line ends in\n\n' ); }); test('multiple file names', t => { const result = shell.sed('test', 'hello', `${t.context.tmp}/file1`, `${t.context.tmp}/file2`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello1\nhello2'); }); test('array of file names (and try it out with a simple regex)', t => { const result = shell.sed(/t.*st/, 'hello', [`${t.context.tmp}/file1`, `${t.context.tmp}/file2`]); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello1\nhello2'); }); test('multiple file names, with in-place-replacement', t => { const result = shell.sed('-i', 'test', 'hello', [`${t.context.tmp}/file1`, `${t.context.tmp}/file2`]); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello1\nhello2'); t.is(shell.cat(`${t.context.tmp}/file1`).toString(), 'hello1'); t.is(shell.cat(`${t.context.tmp}/file2`).toString(), 'hello2'); }); test('glob file names, with in-place-replacement', t => { t.is(shell.cat(`${t.context.tmp}/file1.txt`).toString(), 'test1\n'); t.is(shell.cat(`${t.context.tmp}/file2.txt`).toString(), 'test2\n'); const result = shell.sed('-i', 'test', 'hello', `${t.context.tmp}/file*.txt`); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'hello1\n\nhello2\n'); // TODO: fix sed's behavior t.is(shell.cat(`${t.context.tmp}/file1.txt`).toString(), 'hello1\n'); t.is(shell.cat(`${t.context.tmp}/file2.txt`).toString(), 'hello2\n'); }); test('empty file', t => { const result = shell.sed('widget', 'wizzle', 'test/resources/sed/empty.txt'); t.is(result.code, 0); t.is(result.toString(), ''); }); node-shelljs-0.8.3/test/set.js000066400000000000000000000051631342005425100162220ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; import utils from './utils/utils'; const oldConfigSilent = shell.config.silent; const uncaughtErrorExitCode = 1; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.cp('-r', 'test/resources', t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Valids // test('initial values', t => { t.false(oldConfigSilent); t.false(shell.config.verbose); t.false(shell.config.fatal); t.false(shell.config.noglob); }); test('default behavior', t => { const result = shell.exec(JSON.stringify(shell.config.execPath) + ' -e "require(\'./global\'); ls(\'file_doesnt_exist\'); echo(1234);"'); t.is(result.code, 0); t.is(result.stdout, '1234\n'); t.is(result.stderr, 'ls: no such file or directory: file_doesnt_exist\n'); }); test('set -e', t => { const result = shell.exec(JSON.stringify(shell.config.execPath) + ' -e "require(\'./global\'); set(\'-e\'); ls(\'file_doesnt_exist\'); echo(1234);"'); t.is(result.code, uncaughtErrorExitCode); t.is(result.stdout, ''); t.truthy(result.stderr.indexOf('Error: ls: no such file or directory: file_doesnt_exist') >= 0); }); test('set -v', t => { const result = shell.exec(JSON.stringify(shell.config.execPath) + ' -e "require(\'./global\'); set(\'-v\'); ls(\'file_doesnt_exist\'); echo(1234);"'); t.is(result.code, 0); t.is(result.stdout, '1234\n'); t.is( result.stderr, 'ls file_doesnt_exist\nls: no such file or directory: file_doesnt_exist\necho 1234\n' ); }); test('set -ev', t => { const result = shell.exec(JSON.stringify(shell.config.execPath) + ' -e "require(\'./global\'); set(\'-ev\'); ls(\'file_doesnt_exist\'); echo(1234);"'); t.is(result.code, uncaughtErrorExitCode); t.is(result.stdout, ''); t.truthy(result.stderr.indexOf('Error: ls: no such file or directory: file_doesnt_exist') >= 0); t.truthy(result.stderr.indexOf('ls file_doesnt_exist\n') >= 0); t.is(result.stderr.indexOf('echo 1234\n'), -1); }); test('set -e, set +e', t => { const result = shell.exec(JSON.stringify(shell.config.execPath) + ' -e "require(\'./global\'); set(\'-e\'); set(\'+e\'); ls(\'file_doesnt_exist\'); echo(1234);"'); t.is(result.code, 0); t.is(result.stdout, '1234\n'); t.is(result.stderr, 'ls: no such file or directory: file_doesnt_exist\n'); }); test('set -f', t => { shell.set('-f'); // disable globbing shell.rm(`${t.context.tmp}/*.txt`); t.truthy(shell.error()); // file '*.txt' doesn't exist, so rm() fails shell.set('+f'); shell.rm(`${t.context.tmp}/*.txt`); t.falsy(shell.error()); // globbing works, so rm succeeds }); node-shelljs-0.8.3/test/shjs.js000066400000000000000000000027201342005425100163720ustar00rootroot00000000000000import path from 'path'; import test from 'ava'; import shell from '..'; const binPath = path.resolve(__dirname, '../bin/shjs'); function runWithShjs(name) { // prefix with 'node ' for Windows, don't prefix for unix const execPath = process.platform === 'win32' ? `${JSON.stringify(shell.config.execPath)} ` : ''; const script = path.resolve(__dirname, 'resources', 'shjs', name); return shell.exec(`${execPath}${binPath} ${script}`, { silent: true }); } // // Valids // test('Non-zero exit code', t => { const result = runWithShjs('exit-codes.js'); t.is(result.code, 42); t.is(result.stdout, ''); t.falsy(result.stderr); }); test('Zero exit code', t => { const result = runWithShjs('exit-0.js'); t.is(result.code, 0); t.is(result.stdout, ''); t.falsy(result.stderr); }); test('Stdout/Stderr', t => { const result = runWithShjs('stdout-stderr.js'); t.is(result.code, 0); t.is(result.stdout, 'stdout: OK!\n'); t.is(result.stderr, 'stderr: OK!\n'); }); test('CoffeeScript', t => { const result = runWithShjs('coffeescript.coffee'); t.is(result.code, 0); t.is(result.stdout, 'CoffeeScript: OK!\n'); t.falsy(result.stderr); }); test('Extension detection', t => { const result = runWithShjs('a-file'); t.is(result.code, 0); t.is(result.stdout, 'OK!\n'); t.falsy(result.stderr); }); // // Invalids // test('disallow require-ing', t => { t.throws(() => require(binPath), 'Executable-only module should not be required'); }); node-shelljs-0.8.3/test/sort.js000066400000000000000000000055311342005425100164150ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; shell.config.silent = true; const doubleSorted = shell.cat('test/resources/sort/sorted') .trimRight() .split('\n') .reduce((prev, cur) => prev.concat([cur, cur]), []) .join('\n') + '\n'; // // Invalids // test('no args', t => { const result = shell.sort(); t.truthy(shell.error()); t.truthy(result.code); }); test('file does not exist', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.sort('/asdfasdf'); t.truthy(shell.error()); t.truthy(result.code); }); test('directory', t => { t.truthy(common.statFollowLinks('test/resources/').isDirectory()); // sanity check const result = shell.sort('test/resources/'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'sort: read failed: test/resources/: Is a directory'); }); // // Valids // test('simple', t => { const result = shell.sort('test/resources/sort/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/sort/sorted').toString()); }); test('simple #2', t => { const result = shell.sort('test/resources/sort/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/sort/sorted').toString()); }); test('multiple files', t => { const result = shell.sort('test/resources/sort/file2', 'test/resources/sort/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), doubleSorted); }); test('multiple files, array syntax', t => { const result = shell.sort(['test/resources/sort/file2', 'test/resources/sort/file1']); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), doubleSorted); }); test('Globbed file', t => { const result = shell.sort('test/resources/sort/file?'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), doubleSorted); }); test('With \'-n\' option', t => { const result = shell.sort('-n', 'test/resources/sort/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/sort/sortedDashN').toString()); }); test('With \'-r\' option', t => { const result = shell.sort('-r', 'test/resources/sort/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/sort/sorted') .trimRight() .split('\n') .reverse() .join('\n') + '\n'); }); test('With \'-rn\' option', t => { const result = shell.sort('-rn', 'test/resources/sort/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/sort/sortedDashN') .trimRight() .split('\n') .reverse() .join('\n') + '\n'); }); node-shelljs-0.8.3/test/tail.js000066400000000000000000000104441342005425100163560ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; shell.config.silent = true; // // Invalids // test('no args', t => { const result = shell.tail(); t.truthy(shell.error()); t.is(result.code, 1); }); test('file does not exist', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.tail('/asdfasdf'); t.truthy(shell.error()); t.is(result.code, 1); }); test('directory', t => { t.truthy(common.statFollowLinks('test/resources/').isDirectory()); // sanity check const result = shell.tail('test/resources/'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "tail: error reading 'test/resources/': Is a directory"); }); // // Valids // const bottomOfFile1 = ['file1 50', 'file1 49', 'file1 48', 'file1 47', 'file1 46', 'file1 45', 'file1 44', 'file1 43', 'file1 42', 'file1 41', 'file1 40', 'file1 39', 'file1 38', 'file1 37', 'file1 36', 'file1 35', 'file1 34', 'file1 33', 'file1 32', 'file1 31']; const bottomOfFile2 = ['file2 50', 'file2 49', 'file2 48', 'file2 47', 'file2 46', 'file2 45', 'file2 44', 'file2 43', 'file2 42', 'file2 41', 'file2 40', 'file2 39', 'file2 38', 'file2 37', 'file2 36', 'file2 35', 'file2 34', 'file2 33', 'file2 32', 'file2 31']; test('simple', t => { const result = shell.tail('test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile1.slice(0, 10).reverse().join('\n') + '\n'); }); test('multiple files', t => { const result = shell.tail('test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile2 .slice(0, 10) .reverse() .concat(bottomOfFile1.slice(0, 10).reverse()) .join('\n') + '\n'); }); test('multiple files, array syntax', t => { const result = shell.tail(['test/resources/head/file2.txt', 'test/resources/head/file1.txt']); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile2 .slice(0, 10) .reverse() .concat(bottomOfFile1.slice(0, 10).reverse()) .join('\n') + '\n'); }); test('reading more lines than are in the file (no trailing newline)', t => { const result = shell.tail('test/resources/file2', 'test/resources/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'test2\ntest1'); // these files only have one line (no \n) }); test('reading more lines than are in the file (with trailing newline)', t => { const result = shell.tail('test/resources/head/shortfile2', 'test/resources/head/shortfile1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), 'short2\nshort1\n'); // these files only have one line (with \n) }); test('Globbed file', t => { const result = shell.tail('test/resources/head/file?.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile1 .slice(0, 10) .reverse() .concat(bottomOfFile2.slice(0, 10).reverse()) .join('\n') + '\n'); }); test('With `\'-n\' ` option', t => { const result = shell.tail('-n', 4, 'test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile2 .slice(0, 4) .reverse() .concat(bottomOfFile1.slice(0, 4).reverse()) .join('\n') + '\n'); }); test('With `{\'-n\': }` option', t => { const result = shell.tail({ '-n': 4 }, 'test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile2 .slice(0, 4) .reverse() .concat(bottomOfFile1.slice(0, 4).reverse()) .join('\n') + '\n'); }); test('negative values are the same as positive values', t => { const result = shell.tail('-n', -4, 'test/resources/head/file2.txt', 'test/resources/head/file1.txt'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), bottomOfFile2 .slice(0, 4) .reverse() .concat(bottomOfFile1.slice(0, 4).reverse()) .join('\n') + '\n'); }); node-shelljs-0.8.3/test/tempdir.js000066400000000000000000000011141342005425100170630ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import { isCached, clearCache } from '../src/tempdir'; shell.config.silent = true; // // Valids // test('basic usage', t => { const tmp = shell.tempdir(); t.falsy(shell.error()); t.truthy(fs.existsSync(tmp)); // It's a directory t.truthy(shell.test('-d', tmp)); }); test('cache', t => { clearCache(); // In case this runs after any test which relies on tempdir(). t.falsy(isCached()); const tmp1 = shell.tempdir(); t.truthy(isCached()); const tmp2 = shell.tempdir(); t.is(tmp1, tmp2); }); node-shelljs-0.8.3/test/test.js000066400000000000000000000055751342005425100164150ustar00rootroot00000000000000import test from 'ava'; import shell from '..'; import utils from './utils/utils'; shell.config.silent = true; // // Invalids // test('no expression given', t => { shell.test(); t.truthy(shell.error()); }); test('bad expression', t => { shell.test('asdf'); t.truthy(shell.error()); }); test('bad expression #2', t => { shell.test('f', 'test/resources/file1'); t.truthy(shell.error()); }); test('no file', t => { shell.test('-f'); t.truthy(shell.error()); }); // // Valids // test('-e option succeeds for files', t => { const result = shell.test('-e', 'test/resources/file1'); t.falsy(shell.error()); t.truthy(result); }); test('-e option fails if it does not exist', t => { const result = shell.test('-e', 'test/resources/404'); t.falsy(shell.error()); t.falsy(result); }); test('-d option succeeds for a directory', t => { const result = shell.test('-d', 'test/resources'); t.falsy(shell.error()); t.truthy(result); }); test('-f option fails for a directory', t => { const result = shell.test('-f', 'test/resources'); t.falsy(shell.error()); t.falsy(result); }); test('-L option fails for a directory', t => { const result = shell.test('-L', 'test/resources'); t.falsy(shell.error()); t.falsy(result); }); test('-d option fails for a file', t => { const result = shell.test('-d', 'test/resources/file1'); t.falsy(shell.error()); t.falsy(result); }); test('-f option succeeds for a file', t => { const result = shell.test('-f', 'test/resources/file1'); t.falsy(shell.error()); t.truthy(result); }); test('-L option fails for a file', t => { const result = shell.test('-L', 'test/resources/file1'); t.falsy(shell.error()); t.falsy(result); }); test('test command is not globbed', t => { // regression #529 const result = shell.test('-f', 'test/resources/**/*.js'); t.falsy(shell.error()); t.falsy(result); }); // TODO(nate): figure out a way to test links on Windows test('-d option fails for a link', t => { utils.skipOnWin(t, () => { const result = shell.test('-d', 'test/resources/link'); t.falsy(shell.error()); t.falsy(result); }); }); test('-f option succeeds for a link', t => { utils.skipOnWin(t, () => { const result = shell.test('-f', 'test/resources/link'); t.falsy(shell.error()); t.truthy(result); }); }); test('-L option succeeds for a symlink', t => { utils.skipOnWin(t, () => { const result = shell.test('-L', 'test/resources/link'); t.falsy(shell.error()); t.truthy(result); }); }); test('-L option works for broken symlinks', t => { utils.skipOnWin(t, () => { const result = shell.test('-L', 'test/resources/badlink'); t.falsy(shell.error()); t.truthy(result); }); }); test('-L option fails for missing files', t => { utils.skipOnWin(t, () => { const result = shell.test('-L', 'test/resources/404'); t.falsy(shell.error()); t.falsy(result); }); }); node-shelljs-0.8.3/test/to.js000066400000000000000000000026631342005425100160530ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('Normal strings don\'t have \'.to()\' anymore', t => { const str = 'hello world'; t.is(str.to, undefined); }); test('no file argument', t => { shell.ShellString('hello world').to(); t.truthy(shell.error()); }); test('cannot write to a non-existent directory', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check shell.ShellString('hello world').to('/asdfasdf/file'); t.truthy(shell.error()); }); // // Valids // test('can be chained', t => { shell.ShellString('hello world').to(`${t.context.tmp}/to1`).to(`${t.context.tmp}/to2`); let result = shell.cat(`${t.context.tmp}/to1`); t.falsy(shell.error()); t.is(result.toString(), 'hello world'); result = shell.cat(`${t.context.tmp}/to2`); t.falsy(shell.error()); t.is(result.toString(), 'hello world'); }); test('With a glob', t => { shell.touch(`${t.context.tmp}/to1`); shell.ShellString('goodbye').to(`${t.context.tmp}/t*1`); t.falsy(fs.existsSync(`${t.context.tmp}/t*1`), 'globs are not interpreted literally'); const result = shell.cat(`${t.context.tmp}/to1`); t.falsy(shell.error()); t.is(result.toString(), 'goodbye'); }); node-shelljs-0.8.3/test/toEnd.js000066400000000000000000000042451342005425100165000ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // // Invalids // test('Normal strings don\'t have \'.toEnd()\' anymore', t => { const str = 'hello world'; t.is(str.toEnd, undefined); }); test('missing file argument', t => { shell.ShellString('hello world').toEnd(); t.truthy(shell.error()); }); test('cannot write to a non-existent directory', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check shell.ShellString('hello world').toEnd('/asdfasdf/file'); t.truthy(shell.error()); }); // // Valids // test('creates a new file', t => { t.falsy(fs.existsSync(`${t.context.tmp}/toEnd1`)); // Check file toEnd() creates does not already exist shell.ShellString('hello ').toEnd(`${t.context.tmp}/toEnd1`); t.truthy(fs.existsSync(`${t.context.tmp}/toEnd1`)); // Check that file was created const result = shell.cat(`${t.context.tmp}/toEnd1`); t.is(result.toString(), 'hello '); }); test('can be chained', t => { t.falsy(fs.existsSync(`${t.context.tmp}/toEnd1`)); t.falsy(fs.existsSync(`${t.context.tmp}/toEnd2`)); shell.ShellString('hello ').toEnd(`${t.context.tmp}/toEnd1`); shell.ShellString('world') .toEnd(`${t.context.tmp}/toEnd1`) .toEnd(`${t.context.tmp}/toEnd2`); // Write some more to the file const result1 = shell.cat(`${t.context.tmp}/toEnd1`); t.falsy(shell.error()); t.is(result1.toString(), 'hello world'); // Check that the result is what we expect const result2 = shell.cat(`${t.context.tmp}/toEnd2`); t.falsy(shell.error()); t.is(result2.toString(), 'world'); // Check that the result is what we expect }); test('With a glob', t => { shell.touch(`${t.context.tmp}/toEnd1`); shell.ShellString('good').to(`${t.context.tmp}/toE*1`); shell.ShellString('bye').toEnd(`${t.context.tmp}/toE*1`); t.falsy( fs.existsSync(`${t.context.tmp}/toE*1`) ); const result = shell.cat(`${t.context.tmp}/toEnd1`); t.falsy(shell.error()); t.is(result.toString(), 'goodbye'); }); node-shelljs-0.8.3/test/touch.js000066400000000000000000000113511342005425100165450ustar00rootroot00000000000000import crypto from 'crypto'; import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; import utils from './utils/utils'; test.beforeEach(t => { t.context.tmp = utils.getTempDir(); shell.config.resetForTesting(); shell.mkdir(t.context.tmp); }); test.afterEach.always(t => { shell.rm('-rf', t.context.tmp); }); // Helper functions function resetUtimes(f) { const d = new Date(); d.setYear(2000); fs.utimesSync(f, d, d); return common.statFollowLinks(f); } function tmpFile(t, noCreate) { const str = crypto.randomBytes(Math.ceil(10 / 2)).toString('hex'); const file = `${t.context.tmp}/${str}`; if (!noCreate) { fs.closeSync(fs.openSync(file, 'a')); } return file; } // // Valids // test('should handle args', t => { const result = shell.touch(); t.truthy(shell.error()); t.is(result.code, 1); }); test('arguments must be strings', t => { const result = shell.touch(1); t.truthy(shell.error()); t.is(result.code, 1); }); test('exits without error when trying to touch a directory', t => { const result = shell.touch(t.context.tmp); t.falsy(shell.error()); t.is(result.code, 0); }); test('creates new files', t => { const testFile = tmpFile(t); const result = shell.touch(testFile); t.truthy(fs.existsSync(testFile)); t.is(result.code, 0); }); test('does not create a file if told not to', t => { const testFile = tmpFile(t, true); const result = shell.touch('-c', testFile); t.is(result.code, 0); t.falsy(fs.existsSync(testFile)); }); test('handles globs correctly', t => { shell.touch(`${t.context.tmp}/file.txt`); shell.touch(`${t.context.tmp}/file.js`); const result = shell.touch(`${t.context.tmp}/file*`); t.is(result.code, 0); const files = shell.ls(`${t.context.tmp}/file*`); t.truthy(files.indexOf(`${t.context.tmp}/file.txt`) > -1); t.truthy(files.indexOf(`${t.context.tmp}/file.js`) > -1); t.is(files.length, 2); }); test('errors if reference file is not found', t => { const testFile = tmpFile(t); const refFile = tmpFile(t, true); const result = shell.touch({ '-r': refFile }, testFile); t.is(result.code, 1); t.truthy(shell.error()); }); test('uses a reference file for mtime', t => { const testFile = tmpFile(t); const testFile2 = tmpFile(t); shell.touch(testFile2); utils.sleep(1000); let result = shell.touch(testFile); t.falsy(shell.error()); t.is(result.code, 0); t.not( common.statFollowLinks(testFile).mtime.getTime(), common.statFollowLinks(testFile2).mtime.getTime() ); t.not( common.statFollowLinks(testFile).atime.getTime(), common.statFollowLinks(testFile2).atime.getTime() ); result = shell.touch({ '-r': testFile2 }, testFile); t.falsy(shell.error()); t.is(result.code, 0); t.is( common.statFollowLinks(testFile).mtime.getTime(), common.statFollowLinks(testFile2).mtime.getTime() ); t.is( common.statFollowLinks(testFile).atime.getTime(), common.statFollowLinks(testFile2).atime.getTime() ); }); test('sets mtime and atime by default', t => { const testFile = tmpFile(t); const oldStat = resetUtimes(testFile); const result = shell.touch(testFile); t.is(result.code, 0); t.truthy(oldStat.mtime < common.statFollowLinks(testFile).mtime); t.truthy(oldStat.atime < common.statFollowLinks(testFile).atime); }); test('does not set mtime if told not to', t => { const testFile = tmpFile(t); const oldStat = resetUtimes(testFile); const result = shell.touch('-a', testFile); t.is(result.code, 0); t.is(oldStat.mtime.getTime(), common.statFollowLinks(testFile).mtime.getTime()); }); test('does not set atime if told not to', t => { const testFile = tmpFile(t); const oldStat = resetUtimes(testFile); const result = shell.touch('-m', testFile); t.is(result.code, 0); t.is(oldStat.atime.getTime(), common.statFollowLinks(testFile).atime.getTime()); }); test('multiple files', t => { const testFile = tmpFile(t, true); const testFile2 = tmpFile(t, true); shell.rm('-f', testFile, testFile2); const result = shell.touch(testFile, testFile2); t.is(result.code, 0); t.truthy(fs.existsSync(testFile)); t.truthy(fs.existsSync(testFile2)); }); test('file array', t => { const testFile = tmpFile(t, true); const testFile2 = tmpFile(t, true); shell.rm('-f', testFile, testFile2); const result = shell.touch([testFile, testFile2]); t.is(result.code, 0); t.truthy(fs.existsSync(testFile)); t.truthy(fs.existsSync(testFile2)); }); test('touching broken link creates a new file', t => { utils.skipOnWin(t, () => { const result = shell.touch('test/resources/badlink'); t.is(result.code, 0); t.falsy(shell.error()); t.truthy(fs.existsSync('test/resources/not_existed_file')); shell.rm('test/resources/not_existed_file'); }); }); node-shelljs-0.8.3/test/uniq.js000066400000000000000000000056101342005425100164000ustar00rootroot00000000000000import fs from 'fs'; import test from 'ava'; import shell from '..'; import common from '../src/common'; shell.config.silent = true; // // Invalids // test('no args', t => { const result = shell.uniq(); t.truthy(shell.error()); t.truthy(result.code); }); test('file does not exist', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.uniq('/asdfasdf'); t.truthy(shell.error()); t.truthy(result.code); }); test('directory', t => { t.truthy(common.statFollowLinks('test/resources/').isDirectory()); // sanity check const result = shell.uniq('test/resources/'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, "uniq: error reading 'test/resources/'"); }); test('output directory', t => { t.truthy(common.statFollowLinks('test/resources/').isDirectory()); // sanity check const result = shell.uniq('test/resources/file1.txt', 'test/resources/'); t.truthy(shell.error()); t.is(result.code, 1); t.is(result.stderr, 'uniq: test/resources/: Is a directory'); }); test('file does not exist with output directory', t => { t.falsy(fs.existsSync('/asdfasdf')); // sanity check const result = shell.uniq('/asdfasdf', 'test/resources/'); t.is(result.code, 1); t.truthy(shell.error()); }); // // Valids // test('uniq file1', t => { const result = shell.uniq('test/resources/uniq/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file1u').toString()); }); test('uniq -i file2', t => { const result = shell.uniq('-i', 'test/resources/uniq/file2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file2u').toString()); }); test('with glob character', t => { const result = shell.uniq('-i', 'test/resources/uniq/fi?e2'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file2u').toString()); }); test('uniq file1 file2', t => { const result = shell.uniq('test/resources/uniq/file1', 'test/resources/uniq/file1t'); t.falsy(shell.error()); t.is(result.code, 0); t.is( shell.cat('test/resources/uniq/file1u').toString(), shell.cat('test/resources/uniq/file1t').toString() ); }); test('cat file1 |uniq', t => { const result = shell.cat('test/resources/uniq/file1').uniq(); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file1u').toString()); }); test('uniq -c file1', t => { const result = shell.uniq('-c', 'test/resources/uniq/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file1c').toString()); }); test('uniq -d file1', t => { const result = shell.uniq('-d', 'test/resources/uniq/file1'); t.falsy(shell.error()); t.is(result.code, 0); t.is(result.toString(), shell.cat('test/resources/uniq/file1d').toString()); }); node-shelljs-0.8.3/test/utils/000077500000000000000000000000001342005425100162245ustar00rootroot00000000000000node-shelljs-0.8.3/test/utils/mocks.js000066400000000000000000000016661342005425100177070ustar00rootroot00000000000000function addToString(str, val) { if (Buffer.isBuffer(val)) { return str + val.toString(); } return str + val; } function joinData(data) { return data.reduce(addToString, ''); } function wrapWrite(target) { return function write(val) { target.push(val); return true; }; } const _processStdoutWrite = process.stdout.write; const _processStderrWrite = process.stderr.write; const _stdout = []; const _stderr = []; const _stdoutWrite = wrapWrite(_stdout); const _stderrWrite = wrapWrite(_stderr); exports.stdout = function stdout() { return joinData(_stdout); }; exports.stderr = function stderr() { return joinData(_stderr); }; exports.init = function init() { process.stdout.write = _stdoutWrite; process.stderr.write = _stderrWrite; }; exports.restore = function restore() { process.stdout.write = _processStdoutWrite; process.stderr.write = _processStderrWrite; _stdout.splice(0); _stderr.splice(0); }; node-shelljs-0.8.3/test/utils/utils.js000066400000000000000000000042121342005425100177210ustar00rootroot00000000000000const child = require('child_process'); const path = require('path'); const chalk = require('chalk'); const common = require('../../src/common'); // Capture process.stderr.write, otherwise we have a conflict with mocks.js const _processStderrWrite = process.stderr.write.bind(process.stderr); function numLines(str) { return typeof str === 'string' ? (str.match(/\n/g) || []).length + 1 : 0; } exports.numLines = numLines; function getTempDir() { // a very random directory return ('tmp' + Math.random() + Math.random()).replace(/\./g, ''); } exports.getTempDir = getTempDir; // On Windows, symlinks for files need admin permissions. This helper // skips certain tests if we are on Windows and got an EPERM error function skipOnWinForEPERM(action, testCase) { const ret = action(); const error = ret.code; const isWindows = process.platform === 'win32'; if (isWindows && error && /EPERM:/.test(error)) { _processStderrWrite('Got EPERM when testing symlinks on Windows. Assuming non-admin environment and skipping test.\n'); } else { testCase(); } } exports.skipOnWinForEPERM = skipOnWinForEPERM; function runScript(script, cb) { child.execFile(common.config.execPath, ['-e', script], cb); } exports.runScript = runScript; function sleep(time) { const testDirectoryPath = path.dirname(__dirname); child.execFileSync(common.config.execPath, [ path.join(testDirectoryPath, 'resources', 'exec', 'slow.js'), time.toString(), ]); } exports.sleep = sleep; function mkfifo(dir) { if (process.platform !== 'win32') { const fifo = dir + 'fifo'; child.execFileSync('mkfifo', [fifo]); return fifo; } return null; } exports.mkfifo = mkfifo; function skipIfTrue(booleanValue, t, closure) { if (booleanValue) { _processStderrWrite( chalk.yellow('Warning: skipping platform-dependent test ') + chalk.bold.white(`'${t._test.title}'`) + '\n' ); t.truthy(true); // dummy assertion to satisfy ava v0.19+ } else { closure(); } } exports.skipOnUnix = skipIfTrue.bind(module.exports, process.platform !== 'win32'); exports.skipOnWin = skipIfTrue.bind(module.exports, process.platform === 'win32'); node-shelljs-0.8.3/test/which.js000066400000000000000000000055111342005425100165260ustar00rootroot00000000000000import fs from 'fs'; import path from 'path'; import test from 'ava'; import shell from '..'; import utils from './utils/utils'; shell.config.silent = true; // // Invalids // test('no args', t => { shell.which(); t.truthy(shell.error()); }); test('command does not exist in the path', t => { const result = shell.which('asdfasdfasdfasdfasdf'); // what are the odds... t.falsy(shell.error()); t.falsy(result); }); // // Valids // // TODO(nate): make sure this does not have a false negative if 'git' is missing test('basic usage', t => { const git = shell.which('git'); t.is(git.code, 0); t.falsy(git.stderr); t.falsy(shell.error()); t.truthy(fs.existsSync(git.toString())); }); test('Windows can search with or without a .exe extension', t => { utils.skipOnUnix(t, () => { // This should be equivalent on Windows const node = shell.which('node'); const nodeExe = shell.which('node.exe'); t.falsy(shell.error()); // If the paths are equal, then this file *should* exist, since that's // already been checked. t.is(node.toString(), nodeExe.toString()); }); }); test('Searching with -a flag returns an array', t => { const commandName = 'node'; // Should be an existing command const result = shell.which('-a', commandName); t.falsy(shell.error()); t.truthy(result); t.not(result.length, 0); }); test('Searching with -a flag for not existing command returns an empty array', t => { const notExist = '6ef25c13209cb28ae465852508cc3a8f3dcdc71bc7bcf8c38379ba38me'; const result = shell.which('-a', notExist); t.falsy(shell.error()); t.is(result.length, 0); }); test('Searching with -a flag returns an array with first item equals to the regular search', t => { const commandName = 'node'; // Should be an existing command const resultForWhich = shell.which(commandName); const resultForWhichA = shell.which('-a', commandName); t.falsy(shell.error()); t.truthy(resultForWhich); t.truthy(resultForWhichA); t.is(resultForWhich.toString(), resultForWhichA[0]); }); test('None executable files does not appear in the result list', t => { const commandName = 'node'; // Should be an existing command const extraPath = path.resolve(__dirname, 'resources', 'which'); const matchingFile = path.resolve(extraPath, commandName); const pathEnv = process.env.PATH; // make sure that file is exists (will throw error otherwise) t.truthy(fs.existsSync(matchingFile)); process.env.PATH = extraPath + path.delimiter + process.env.PATH; const resultForWhich = shell.which(commandName); const resultForWhichA = shell.which('-a', commandName); t.falsy(shell.error()); t.truthy(resultForWhich); t.truthy(resultForWhichA); t.truthy(resultForWhichA.length); t.not(resultForWhich.toString(), matchingFile); t.is(resultForWhichA.indexOf(matchingFile), -1); process.env.PATH = pathEnv; });