path-to-slug
v1.0.0
Published
Convert file path to slugs.
Readme
path-to-slug
Convert file path to slugs.
- Typescript support
- Zero dependencies
npm i path-to-slugUsages
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
