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

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

Awesome Lists containing this project

README

          

safename
========

Normalize diacritics and dashes, and transform spaces from strings

[![Build Status](https://travis-ci.org/jacoborus/safename.svg?branch=master)](https://travis-ci.org/jacoborus/safename)

## Example

```js
import { safename } from 'safename'

safename('My file name 1234 Ñáëîò~')
// => My_file_name_1234_Naeio

safename('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)