Socket
Socket
Sign inDemoInstall

cli-cwd

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cli-cwd

Run command with modified CWD (current working directory)


Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Install size
15.1 kB
Created
Weekly downloads
 

Readme

Source

cli-cwd Dependency Status

npm

Runs specified command with modified CWD, redirecting all stdio in the correct way (i.e. you can pipe or redirect stdin/stdout/stderr).

The package installs cwd command with the following signature:

cwd <directory> -- <command> [arg]...

Examples

$ cwd /usr/bin -- pwd
/usr/bin

$ cwd /usr/bin -- ls |ack '^zip'
zip
zipcloak
zipgrep
zipinfo
zipnote
zipsplit

More realistic example — universally operate on directories no-matter-what-flag-tool-authors-have-chosen-to-use.

$ cwd ./dir -- tar cvaf ../dir.tbz2 .
$ cwd ./dir -- zip -r ../dir .
$ cwd ./dir -- 7z a ../dir . -tzip

In all of these cases files are saved with file names relative to ./dir.

CLI

Usage:  cwd <directory> -- <command> [arg]...

API

Well, there is an API, but you should definitely use Node's own child_process.exec instead. Take a look at index.js if you are not convinced.

Install

npm install -g cli-cwd

License

MIT

Keywords

FAQs

Last updated on 21 Nov 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc