Socket
Socket
Sign inDemoInstall

safename

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

safename

Get safe file name from a given string.


Version published
Maintainers
1
Weekly downloads
1,232
decreased by-24.14%
Install size
13.7 kB

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 18 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc