global-node-modules
Find the global node_modules path.
Last updated 4 years ago by rem .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install global-node-modules 
SYNC missed versions from official npm registry.

global-node-modules NPM version NPM downloads Build Status

Find the global node_modules path.

Install

$ npm install --save global-node-modules

Usage

const globalNodeModules = require('global-node-modules')

globalNodeModules()
  .then(nodeModulesPath => {
    console.log(nodeModulesPath)
    //=> /Users/egoist/.nvm/versions/node/v4.2.4/lib/node_modules
  })
  .catch(e => {
    console.log(e.stack)
  })

// sync method
const nodeModulesPath = globalNodeModules.sync()

API

globalNodeModules(moduleName)

moduleName

Type: string
Default: ''

Give a moduleName to append to the path.

globalNodeModules.sync(moduleName)

License

MIT © EGOIST

Current Tags

  • 2.1.0                                ...           latest (4 years ago)

6 Versions

  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |