@npmcli/name-from-folder
Get the package name from a folder path
Last updated 2 years ago by lukekarrys .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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

  • 2.0.0                                ...           latest (2 years ago)

3 Versions

  • 2.0.0                                ...           2 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |