fuma-nama / path-to-slug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

path-to-slug

Convert file path to slugs.

  • Typescript support
  • Zero dependencies
npm i path-to-slug

Usages

For example:

toSlug("/path/to/file.ts");
toSlug("/path/to/index.ts");

Yields

["path", "to", "file"]
["path", "to"]

Backward Slashes

Backward slashes are also supported.

toSlug("path\\to\\file.ts");

ESM Only

About


Languages

Language:TypeScript 100.0%