Code Monkey home page Code Monkey logo

node-check-fast's Introduction

@oresoftware/ncf (Node Check Fast)

Version

Running node -c for all the files in your project can take a minute. This project does what it says - use the node.js interface, or the command line interface.

Installation

Local (for programmatic usage) npm install -D '@oresoftware/ncf'

Global (for command line tools, this makes more sense usually) npm install -g '@oresoftware/ncf'

In the beginning:

find -path "*.js" -type f -not -path "**/node_modules/**" | ncf --stdin

Yeah don't do that. We can use sane defaults instead. Instead do this:

 ncf -c 9    # by default we search with the above settings

Programmatic usage with Node.js:

import ncf from '@oresoftware/ncf';  
// likewise: const {ncf} = require('@oresoftware/ncf');


ncf({
  
  root: process.cwd(),   // required: an absolute path representing where to start searching for .js files
  paths: [],             // optional: paths to match
  notPaths: [],          // optional: paths not to match
  concurrency: 8,        // optional: number of processes to run at a time
  maxDepth: 10,          // optional: max number of directories to drill into it
  verbosity: 1
  
}, function(err, results){
    
  // if err is present, a file failed the "node -c" check.
  // results will tell you specifically which files failed
  // if results is an empty array, no files were checked/matched.
  
})

Default values used for both command line and JS usage:

  root: process.cwd(),   
  paths: ['*.js'],             
  notPaths: ['**/node_modules/**'],        
  concurrency: os.cpus().length || 6,
  maxDepth: 12,          
  verbosity: 2

Command line interface:

ncf --dir . --not-paths=**/test/** --not-paths=**/node_modules/** --verbosity 3 --concurrency=8

the terse version of the above is:

ncf -d . --np=**/test/** --np=**/node_modules/** --v 3 -c 8

node-check-fast's People

Contributors

oresoftware avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

node-check-fast's Issues

Missing module -> move to chalk instead

$ ncf
 => node-check-fast exiting with code =>  1
module.js:471
    throw err;
    ^

Error: Cannot find module 'colors/safe'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/alexamil/.nvm/versions/node/v6.10.2/lib/node_modules/node-check-fast/index.js:8:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

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.