@npmcli/name-from-folder
Get the package name from a folder path
Last updated 4 years ago by lukekarrys .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @npmcli/name-from-folder 
SYNC missed versions from official npm registry.

@npmcli/name-from-folder

Get the package name from a folder path, including the scope if the basename of the dirname starts with @.

For a path like /x/y/z/@scope/pkg it'll return @scope/pkg. If the path name is something like /x/y/z/pkg, then it'll return pkg.

USAGE

const nameFromFolder = require('@npmcli/name-from-folder')
const name = nameFromFolder('/some/folder/path')

Current Tags

  • 5.0.0                                ...           latest (7 months ago)

6 Versions

  • 5.0.0                                ...           7 months ago
  • 4.0.0                                ...           a year ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Downloads
Total 21
Today 1
This Week 4
This Month 13
Last Day 0
Last Week 9
Last Month 6
Dependencies (0)
None
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE