https://github.com/jacoborus/safename
Normalize and transform diacritics, dashes, and spaces
https://github.com/jacoborus/safename
dashes diacritics diacritics-removal normalize-string safename string string-manipulation
Last synced: 3 months ago
JSON representation
Normalize and transform diacritics, dashes, and spaces
- Host: GitHub
- URL: https://github.com/jacoborus/safename
- Owner: jacoborus
- License: mit
- Created: 2014-05-19T04:16:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-04-18T21:59:24.000Z (over 4 years ago)
- Last Synced: 2024-11-07T09:08:17.129Z (11 months ago)
- Topics: dashes, diacritics, diacritics-removal, normalize-string, safename, string, string-manipulation
- Language: TypeScript
- Homepage:
- Size: 144 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
safename
========Normalize diacritics and dashes, and transform spaces from strings
[](https://travis-ci.org/jacoborus/safename)
## Example
```js
import { safename } from 'safename'safename('My file name 1234 Ñáëîò~')
// => My_file_name_1234_Naeiosafename('My file name 1234 Ñáëîò~', '.')
// => My.file.name.1234.Naeio
```## Usage
```
safename( name, space )
```**Parameters:**
- **name** *String*: string to transform
- **space** *String*: replace for spaces. Optional, low dash ('_') by default
- **Return** *String*: safe name## Installation
Install with npm
```
$ npm install safename
```Install with Yarn
```
$ yarn add safename
```Tests
-----```
npm install && npm test
```
---
© 2014-2021 [Jacobo Tabernero Rey](https://github.com/jacoborus)
Released under [MIT License](https://raw.github.com/jacoborus/safename/master/LICENSE)