Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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