Giter Site home page Giter Site logo

any-shell-escape's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chocolateboy

any-shell-escape's Issues

Powershell escaping different from Command Prompt

I'm not sure why but I have to write four quotes which turns out to one in Powershell.

my test.js file

console.log(process.argv);

output on powershell

PS C:\> node test "test two three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test two three' ]
PS C:\> node test "test ""two"" three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test two three' ]
PS C:\> node test "test """"two"""" three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test "two" three' ]

output on command prompt (expected and working)

C:\>node test "test two three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test two three' ]

C:\>node test "test ""two"" three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test "two" three' ]

C:\>node test "test """"two"""" three"
[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\test',
  'test ""two"" three' ]

I'm not sure the best way to fix this because the module only knows if it's windows or linux. My only guess on how to fix this is to add in an argument which tells the module if it's for powershell or command prompt. Thoughts or other solutions to this problem?

UNIX support

This breaks on UNIX systems by adding a dollar sign ($) to the front of a string/file path.

Example:

var escape = require('any-shell-escape');
var url = "/var/www/html/file one.js";
console.log(escape([url]));

returns:
$'/var/www/html/file one.js'
not:
'/var/www/html/file one.js'

Some typos in the README

The README is still referring to shell-escape instead of any-shell-escape, including the title.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.