Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

safename

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safename

Get safe file name from a given string.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
increased by20.89%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 18 Apr 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc