# module-name-from-path **Repository Path**: mirrors_watson/module-name-from-path ## Basic Information - **Project Name**: module-name-from-path - **Description**: Extract the Node.js module name given an abosulte path to a file inside the module - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # module-name-from-path Extract the Node.js module name given an absolute path to a file inside the module. [![Build status](https://travis-ci.org/watson/module-name-from-path.svg?branch=master)](https://travis-ci.org/watson/module-name-from-path) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) ## Installation ``` npm install module-name-from-path --save ``` ## Usage ```js 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