# @npmcli/name-from-folder

> Get the package name from a folder path

Latest version **5.0.0** (published 2026-05-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @npmcli/name-from-folder
pnpm add @npmcli/name-from-folder
yarn add @npmcli/name-from-folder
bun add @npmcli/name-from-folder
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-05-08 |
| First published | 2020-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |

## Links

- npm: https://www.npmjs.com/package/@npmcli/name-from-folder
- Repository: https://github.com/npm/name-from-folder
- Homepage: https://github.com/npm/name-from-folder#readme
- Issues: https://github.com/npm/name-from-folder/issues
- npm.io page: https://npm.io/package/@npmcli/name-from-folder

## Recent versions

- 5.0.0 (latest) — 2026-05-08
- 4.0.0 — 2025-10-22
- 3.0.0 — 2024-09-24
- 2.0.0 — 2022-12-13
- 1.0.1 — 2020-03-29
- 1.0.0 — 2020-03-29

## 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

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

---
_Source: https://npm.io/package/@npmcli/name-from-folder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
