Détail du package

@npmcli/name-from-folder

npm17.5mISC4.0.0

Get the package name from a folder path

readme

@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')

changelog

Changelog

4.0.0 (2025-10-22)

⚠️ BREAKING CHANGES

  • align to npm 11 node engine range (#67)

    Bug Fixes

  • 503e5bf #67 align to npm 11 node engine range (#67) (@owlstronaut)

    Chores

  • cfc9588 #66 Bump @npmcli/template-oss from 4.26.0 to 4.27.1 (#66) (@dependabot[bot], @npm-cli-bot)
  • e3d5220 #65 Bump @npmcli/template-oss from 4.25.1 to 4.26.0 (#65) (@dependabot[bot], @npm-cli-bot)
  • b589be5 #64 Bump @npmcli/template-oss from 4.25.0 to 4.25.1 (#64) (@dependabot[bot], @npm-cli-bot)
  • 81698ac #63 Bump @npmcli/template-oss from 4.24.4 to 4.25.0 (#63) (@dependabot[bot], @npm-cli-bot)
  • 8f8da72 #62 Bump @npmcli/template-oss from 4.24.3 to 4.24.4 (#62) (@dependabot[bot], @npm-cli-bot)
  • 56badc6 #61 postinstall workflow updates (#61) (@owlstronaut)
  • b740158 #60 Bump @npmcli/template-oss from 4.23.3 to 4.24.3 (#60) (@dependabot[bot], @npm-cli-bot)

3.0.0 (2024-09-24)

⚠️ BREAKING CHANGES

  • @npmcli/name-from-folder now supports node ^18.17.0 || >=20.5.0

    Bug Fixes

  • 4865201 #56 align to npm 10 node engine range (@hashtagchris)

    Chores

  • c6232a0 #58 enable auto publish (#58) (@reggi)
  • bad5ce6 #56 run template-oss-apply (@hashtagchris)
  • 6901265 #54 Bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
  • 4b07860 #55 Bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])
  • be16c20 #52 Bump @npmcli/template-oss from 4.22.0 to 4.23.1 (@dependabot[bot])
  • f77cefb #43 bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
  • 47a905e #42 Bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])
  • bbae674 #38 Bump @npmcli/template-oss from 4.21.1 to 4.21.3 (@dependabot[bot])
  • a444cf5 #35 Bump @npmcli/template-oss from 4.19.0 to 4.21.1 (@dependabot[bot])
  • 833849b #15 Bump @npmcli/template-oss from 4.13.0 to 4.19.0 (@dependabot[bot])
  • f6eb29a #13 Bump @npmcli/template-oss from 4.11.4 to 4.13.0 (#13) (@dependabot[bot], @npm-cli-bot, @nlf)
  • b382ed4 #12 Bump @npmcli/template-oss from 4.11.3 to 4.11.4 (#12) (@dependabot[bot], @npm-cli-bot, @nlf)
  • 36e8841 #11 Bump @npmcli/template-oss from 4.11.0 to 4.11.3 (@dependabot[bot])
  • 961243e #55 postinstall for dependabot template-oss PR (@hashtagchris)

2.0.0 (2022-12-12)

⚠️ BREAKING CHANGES

  • this package is now compatible with the following semver range for node: ^14.17.0 || ^16.13.0 || >=18.0.0

Features