https://github.com/afeiship/next-sanitize-filename
Sanitize a string to be safe for use as a filename by customize list.
https://github.com/afeiship/next-sanitize-filename
dictionary filename next replacement sanitize strip
Last synced: 25 days ago
JSON representation
Sanitize a string to be safe for use as a filename by customize list.
- Host: GitHub
- URL: https://github.com/afeiship/next-sanitize-filename
- Owner: afeiship
- License: mit
- Created: 2020-11-23T06:26:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-09T08:44:53.000Z (over 4 years ago)
- Last Synced: 2025-03-07T14:18:09.787Z (about 2 months ago)
- Topics: dictionary, filename, next, replacement, sanitize, strip
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-sanitize-filename
> Sanitize a string to be safe for use as a filename by customize list.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
npm install -S @jswork/next-sanitize-filename
```## usage
```js
import '@jswork/next-sanitize-filename';const str = '牛津英语(牛津上海版)1A(一年级上册)(2007年08月第1版)';
nx.sanitizeFilename(str, {
items: [
[/\(/g, '_'],
[/\)/g, '_'],
]
});
// 牛津英语_牛津上海版_1A_一年级上册__2007年08月第1版_
```## license
Code released under [the MIT license](https://github.com/afeiship/next-sanitize-filename/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-sanitize-filename
[version-url]: https://npmjs.org/package/@jswork/next-sanitize-filename[license-image]: https://img.shields.io/npm/l/@jswork/next-sanitize-filename
[license-url]: https://github.com/afeiship/next-sanitize-filename/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-sanitize-filename
[size-url]: https://github.com/afeiship/next-sanitize-filename/blob/master/dist/next-sanitize-filename.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-sanitize-filename
[download-url]: https://www.npmjs.com/package/@jswork/next-sanitize-filename