Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chilijung/path-replace
replace path string to valid path, escaping all spacial characters and spaces to underscore(`_`), which will be useful generating simple urls.
https://github.com/chilijung/path-replace
Last synced: 5 days ago
JSON representation
replace path string to valid path, escaping all spacial characters and spaces to underscore(`_`), which will be useful generating simple urls.
- Host: GitHub
- URL: https://github.com/chilijung/path-replace
- Owner: chilijung
- License: other
- Created: 2017-01-14T13:00:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T14:39:43.000Z (over 6 years ago)
- Last Synced: 2024-11-02T08:50:01.987Z (6 days ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# path-replace [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]
> replace path string to valid path, escaping all spacial characters and spaces to underscore(`_`), which will be useful generating urls.## Installation
```sh
$ npm install --save path-replace
```## Usage
```js
const str = `test~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\ \\/test2`;assert.equal(pathReplace(str), 'test_test2');
```## License
Apache-2.0 © [chilijung]()
[npm-image]: https://badge.fury.io/js/path-replace.svg
[npm-url]: https://npmjs.org/package/path-replace
[travis-image]: https://travis-ci.org/Canner/path-replace.svg?branch=master
[travis-url]: https://travis-ci.org/Canner/path-replace
[daviddm-image]: https://david-dm.org/Canner/path-replace.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/Canner/path-replace