instafork
Instantly copy the source of an npm module locally
⚠️ Use with caution. Instafork is pre-1.0.0 and the api will likely change ⚠️
Injects package content into your file system. Think of it like a fork, except there is no publish step since all module files are in your project source. This means a package is immediately editable for quick iteration.
Installation
npm install --global instafork
Usage
Usage
$ instafork <npm module name>
Examples
$ instafork express
//=> Eject contents of express in current directory
$ mkdir src && instafork express
//=> Eject contents of express into ./src instead if it exists
FAQ
-
What operating systems are supported?
- Unix and Linux. Windows is not supported because it handles
tar
files different from how *nix systems, so that is left out. PR's welcome.
- Unix and Linux. Windows is not supported because it handles
-
Why eject to
./src
if that directory exists?- If you have a
src
directory in your current file location, it's likely you're using some type of build process like babel. Because of this, you can collocate and transpile your newly instaforked module all fromsrc
.
- If you have a
API
Instafork accepts a custom logger object for if you want to log it's usage. The logger passed in has to have a log
method that will be called with three arguments:
/** * @param * @param * @param */ { console; ; }
Create a wrapper on top of instafork and pass in your custom Logger:
const instafork = ;const logger = ; ;
Development
This project was developed with flow and yarn. Ensure that flow check
passes in your contribution. It's included in npm test
for you already.
Adding a new dependency:
yarn add <new dep>
License
MIT