Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmd-fn

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmd-fn

Execute any node module function from the command line.

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

cmd-fn

Execute any node module function from the command line.

Installation

npm install -g cmd-fn

Usage

Usage: cmd-fn [options]

Options:

  -h, --help                output usage information
  -m, --module [name]       module name e.g.: `fs`
  -f, --function [name]     function name
  -c, --cwd [path]          working directory context to run function from
  -p, --params [arguments]  function arguments specified as an array e.g.: `'["foo", "bar"]'`
  --promise                 function is async and uses promises
  --node-callback           function is async with a node-style callback

Example:

  To execute the following node function `fs.readdirSync("/var/tmp")`, you would do:
  $ cmd-fn --module fs --function readdirSync --params '["/var/tmp"]'

  To do an async call like `http.get({"hostname":"www.google.com"}, cb)`:
  $ cmd-fn --module http --function get --params '[{"hostname":"www.google.com"}]' --node-callback

Author

Dave Jeffery (@DaveJ)

FAQs

Package last updated on 31 Jul 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc