Socket
Socket
Sign inDemoInstall

module-details-from-path

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    module-details-from-path

Extract the Node.js module details like name and base path given an abosulte path to a file inside the module


Version published
Weekly downloads
4.8M
decreased by-18.6%
Maintainers
1
Install size
5.23 kB
Created
Weekly downloads
 

Readme

Source

module-details-from-path

Extract the Node.js module details like name and base path given an absolute path to a file inside the module.

Build status js-standard-style

Installation

npm install module-details-from-path --save

Usage

var assert = require('assert')
var parse = require('module-details-from-path')

var path = '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube/bin/tube.js'

assert.deepStrictEqual(parse(path), {
  name: 'picture-tube',
  basedir: '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube',
  path: 'bin/tube.js'
})

Returns undefined if module details cannot be found.

License

MIT

Keywords

FAQs

Last updated on 09 Jul 2016

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