pkg-reflector
Find and install the npm modules
Last updated 3 years ago by zcong .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pkg-reflector 
SYNC missed versions from official npm registry.

pkg-reflector

Build Status NPM version npm npm David

Find and install the npm modules your js files used


New

  • use flag --custom-cmds="external install tool" override the install command, eg: --custom-cmds="cnpm install"

  • use flag --dry to dry run, show the finded npm modules

  • use flag --npm or --yarn choose installing tool (default: prefer yarn if available)

  • support alias prf for pkg-reflector

  • now support multi files, can be used like pkg-reflector src/* libs/* *.js, resolve files using globby and always ignore **/node_modules/**

Install

$ npm install -g pkg-reflector
# using yarn
$ yarn global add pkg-reflector

Feature

Sometimes, we copy some js file from other folder or project, such as rollup.config.js,you only want to use it in your current project.

If the js file depends some npm modules, you should install these first by yourself, like this:

$ yarn add module1 module2 module3...

we may get some error when add modules cause wrong spelling of the long module name, so use pkg-reflector, you can do it like this:

$ prf foo.js
# then all done

easy way, isn't it ?

Usage

$ prf <js file[s]> [options]
# use 'prf -h' for more help

simple

$ prf <file>

will install the pkgs and save dependence.

multi files

$ prf file1 file2 ...

or use patterns all sindresorhus/globby support

$ prf "./**/*.js" 

Note: you should pass args as string "./**/*.js", not ./**/*.js(this will be executed by terminal, if it contains node_modules folder maybe cause error zsh: argument list too long)

Current Tags

  • 3.6.0                                ...           latest (3 years ago)

36 Versions

  • 3.6.0                                ...           3 years ago
  • 3.5.1                                ...           3 years ago
  • 3.5.0                                ...           3 years ago
  • 3.4.2                                ...           3 years ago
  • 3.4.1                                ...           3 years ago
  • 3.4.0                                ...           3 years ago
  • 3.3.0                                ...           3 years ago
  • 3.2.2                                ...           3 years ago
  • 3.2.1                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (12)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |