safename
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

safename

Normalize diacritics and dashes, and transform spaces from strings

Build Status

Example

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

Released under MIT License

Package Sidebar

Install

npm i safename

Weekly Downloads

1,594

Version

2.0.0

License

MIT

Unpacked Size

13.2 kB

Total Files

6

Last publish

Collaborators

  • jacoborus