extra-path
Version:
Useful additions to inbuilt path module.
62 lines (45 loc) ⢠2.27 kB
Markdown
Useful additions to inbuilt [path] module.<br>
š¦ [Node.js](https://www.npmjs.com/package/extra-path),
š [Web](https://www.npmjs.com/package/extra-path.web),
š [Files](https://unpkg.com/extra-path/),
š° [Docs](https://nodef.github.io/extra-path/),
š [Wiki](https://github.com/nodef/extra-bit/wiki/).
This package is available in *Node.js* and *Web* formats. To use it on the web,
simply use the `extra_path` global variable after loading with a `<script>`
tag from the [jsDelivr CDN].
[path]: https://nodejs.org/api/path.html
[jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-path.web/index.js
> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
<br>
```javascript
const xpath = require('extra-path');
function main() {
xpath.filename('/home/user/file+name.txt');
// ā 'file+name'
xpath.symbolname('/home/user/file+name.txt');
// ā 'file_name'
xpath.keywordname('/home/user/file+name.txt');
// ā 'file-name'
}
main();
```
<br>
<br>
## Index
| Property | Description |
| ---- | ---- |
| [filename] | Get file name without extension. |
| [symbolname] | Get symbol name for file. |
| [keywordname] | Get keyword name for file. |
<br>
<br>
[](https://www.youtube.com/watch?v=8oXhShuIjrQ)<br>
[](https://nodef.github.io)
[](https://zenodo.org/badge/latestdoi/179137165)
[](https://coveralls.io/github/nodef/extra-path?branch=master)
[](https://codeclimate.com/github/nodef/extra-path/test_coverage)
[](https://codeclimate.com/github/nodef/extra-path/maintainability)

[filename]: https://github.com/nodef/extra-path/wiki/filename
[symbolname]: https://github.com/nodef/extra-path/wiki/symbolname
[keywordname]: https://github.com/nodef/extra-path/wiki/keywordname