Socket
Book a DemoInstallSign in
Socket

module-name-from-path

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-name-from-path

Extract the Node.js module name given an abosulte path to a file inside the module

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

module-name-from-path

Extract the Node.js module name given an absolute path to a file inside the module.

Build status js-standard-style

Installation

npm install module-name-from-path --save

Usage

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

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

assert.strictEqual(parse(path), 'picture-tube')

Returns undefined if module name cannot be found.

License

MIT

Keywords

node

FAQs

Package last updated on 09 Feb 2016

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