JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3037118
  • Score
    100M100P100Q200494F
  • License Public Domain

Sanitize string for use as filename

Package Exports

  • sanitize-filename

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sanitize-filename) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sanitize-filename

Sanitize a string to be safe for use as a file name in Windows and Unix systems by stripping all control characters and restricted characters (\/:*?"<>|).

Example

var sanitize = require("sanitize-filename"),
    fs = require("fs"),
    filename = sanitize("h*ello:/world?"),
    stream fs.createWriteStream(filename);
fs.end("hello world");

API

sanitize(filename)

Sanitize the input string.

Installation

npm install sanitize-filename