Tabnine Logo For Javascript
is-windows
Code IndexAdd Tabnine to your IDE (free)

How to use is-windows

Best JavaScript code snippets using is-windows(Showing top 9 results out of 315)

origin: micromatch/nanomatch

it('should match escaped characters', function() {
   assert(!mm.isMatch('', '\\'));
   assert(!mm.isMatch('XXX/\\', '[A-Z]+/\\'));
   assert(mm.isMatch('\\', '\\'));
   if (isWindows()) {
    assert(!mm.isMatch('XXX/\\', '[A-Z]+/\\\\'));
   } else {
    assert(mm.isMatch('XXX/\\', '[A-Z]+/\\\\'));
   }
   assert(mm.isMatch('[ab]', '\\[ab]'));
   assert(mm.isMatch('[ab]', '[\\[:]ab]'));
  });
origin: micromatch/extglob

function matcher() {
 if (isWindows()) return;
 return bash.apply(null, arguments);
}
origin: micromatch/nanomatch

describe('slashes', function() {
  it('should match forward slashes', function() {
   assert(nm.isMatch('/', '/'));
  });

  it('should match backslashes', function() {
   assert(nm.isMatch('\\', '[\\\\/]'));
   assert(nm.isMatch('\\', '[\\\\/]+'));
   assert(nm.isMatch('\\\\', '[\\\\/]+'));
   assert(nm.isMatch('\\\\\\', '[\\\\/]+'));

   if (isWindows()) {
    nm(['\\'], '[\\\\/]', ['/']);
    nm(['\\', '\\\\', '\\\\\\'], '[\\\\/]+', ['/']);
   } else {
    nm(['\\'], '[\\\\/]', ['\\']);
    nm(['\\', '\\\\', '\\\\\\'], '[\\\\/]+', ['\\', '\\\\', '\\\\\\']);
   }

   var sep = path.sep;
   path.sep = '\\';
   assert(nm.isMatch('\\', '[\\\\/]'));
   assert(nm.isMatch('\\', '[\\\\/]+'));
   assert(nm.isMatch('\\\\', '[\\\\/]+'));
   assert(nm.isMatch('\\\\\\', '[\\\\/]+'));
   nm(['\\'], '[\\\\/]', ['/']);
   nm(['\\', '\\\\', '\\\\\\'], '[\\\\/]+', ['/']);
   path.sep = sep;
  });
 });
origin: micromatch/nanomatch

mm(['man/man1/bash.1'], '*/man*/bash.*', ['man/man1/bash.1']);
if (isWindows()) {
origin: micromatch/nanomatch

describe('minimatch parity:', function() {
 describe('backslashes', function() {
  it('should match literal backslashes', function() {
   if (isWindows()) {
    mm.match(['\\'], '\\', ['/']);
   } else {
origin: micromatch/nanomatch

describe('.makeRe', function() {
 if (isWindows() || isTravis) {
  console.log('these tests use bash to test for bash parity. since bash does not work on most versions of windows, these tests are skipped on windows');
  return;
     } else if (!isWindows() && !isTravis)  {
      actual = nmRes === nm.bash.isMatch(fixture, pattern);
     } else {
     } else if (/^\?/.test(pattern) || /^\.\//.test(fixture)) {
      actual = true;
     } else if (!isWindows() && !isTravis)  {
      actual = nmRes === nm.bash.isMatch(fixture, pattern, {dot: true});
     } else {
     } else if (/^\?/.test(pattern) || /^\!/.test(fixture)) {
      actual = true;
     } else if (!isWindows() && !isTravis)  {
      actual = nmRes === nm.bash.isMatch(fixture, pattern, {nonegate: true});
     } else {
origin: micromatch/nanomatch

nm(['d', 'e', '!ab', '!abc', 'a!b', '\\!a'], '!!!!a*', ['a!b']);
nm(['d', 'e', '!ab', '!abc', 'a!b', '\\!a'], '!!!!!!a*', ['a!b']);
if (!isWindows()) {
 nm(['d', 'e', '!ab', '!abc', 'a!b', '\\!a'], '!!!!!a*', ['d', 'e', '!ab', '!abc', '\\!a']);
 nm(['d', 'e', '!ab', '!abc', 'a!b', '\\!a'], '!a*', ['d', 'e', '!ab', '!abc', '\\!a']);
origin: micromatch/nanomatch

describe('.isMatch', function() {
 if (isWindows() || isTravis) {
  console.log('these tests use bash to test for bash parity. since bash does not work on most versions of windows, these tests are skipped on windows');
  return;
     } else if (/^\?/.test(pattern)) {
      actual = true;
     } else if (!isWindows() && !isTravis)  {
      actual = nmRes === nm.bash.isMatch(fixture, pattern);
     } else {
     } else if (/^\?/.test(pattern) || /^\.\//.test(fixture)) {
      actual = true;
     } else if (!isWindows() && !isTravis)  {
      actual = nmRes === nm.bash.isMatch(fixture, pattern, {dot: true});
     } else {
     } else if (/^\?/.test(pattern) || /^\!/.test(fixture)) {
      actual = true;
     } else if (!isWindows() && !isTravis) {
      actual = nmRes === nm.bash.isMatch(fixture, pattern);
     } else {
origin: micromatch/nanomatch

it('should use escaped characters as literals:', function() {
   if (isWindows()) {
    mm(fixtures, '\\*', {nonull: true}, ['*', '/*']);
    mm(fixtures, '\\*', {nonull: true, unescape: true}, ['*']);
is-windows(npm)

JSDoc

Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc.

Most used is-windows functions

  • isWindows

Popular in JavaScript

  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • fs
  • mime-types
    The ultimate javascript content-type utility.
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • express
    Fast, unopinionated, minimalist web framework
  • chalk
    Terminal string styling done right
  • async
    Higher-order functions and common patterns for asynchronous code
  • mongodb
    The official MongoDB driver for Node.js
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now