JSPM

escape-path-with-spaces

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 194
  • Score
    100M100P100Q93207F
  • License MIT

Escape if needed spaces contained in a string file path

Package Exports

  • escape-path-with-spaces
  • escape-path-with-spaces/index.js

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 (escape-path-with-spaces) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

escape-path-with-spaces

Escape if needed spaces contained in a string file path

Install

$ npm install --save escape-path-with-spaces

Usage

const escape = require('escape-path-with-spaces');
// some paths
const aWindowsPath = "D:\\DDL\\ANIME\\les chevaliers du zodiaques\\whateverFile.avi";
const aPosixPath = "D:/DDL/ANIME/les chevaliers du zodiaques/whateverFile.avi";

// on Linux or Mac OS X
// gives "D:/DDL/ANIME/les\ chevaliers\ du\ zodiaques/whateverFile.avi"

// on Windows
console.log(escape(aWindowsPath));

// on recent builds ( >= Windows 10 1803)
// give the same path as recent builds handle spaces in path(s) 

// on old builds ( < Windows 10 1803)
// gives "D:\\DDL\\ANIME\\les%20chevaliers%20du%20zodiaques\\whateverFile.avi"

API

escape-path-with-spaces(filePath)

Escape if needed spaces contained in a string file path

License

MIT