constnlp=require('compromise')constdoc=nlp('JS is calling')doc.sentences().toNegative()// 'JS is not calling'
12
doc=nlp("the guest-singer's björk at seven thirty.").normalize().out('text')// 'The guest singer is Bjork at 7:30.'
12345
doc=nlp("we're not gonna take it, no we ain't gonna take it.")doc.has('going')// truedoc.match('are not').length// == 2doc.contractions().expand().out()//'we are not going to take it, no we are not going to take it'
❯ nmotw.in ~ emma
Search packages 📦 : grap
Search results:
11 grap loopingrage Utility that GReps for gAPs and out of sequence line in log
8.4m sass-graph xzyfer Parse sass files and extract a graph of imports
3.7m @types/graphql DefinitelyTyped TypeScript definitions for graphql
❯ 2.9m graphql graphql A Query Language and Runtime which can target any service.
1.8m graphlib dagrejs A directed and undirected multi-graph library
Suggestions results: Press Tab to select suggestions
10.2m react-dom facebook React package for working with the DOM.
14.6m prop-types facebook Runtime type checking for React props and similar objects.
7m classnames JedWatson A simple utility for conditionally joining classNames toget
65.3m lodash lodash Lodash modular utilities.
7.2m redux reactjs Predictable state container for JavaScript apps
Search powered by Algolia.
Picked: Press Space to install packages...
› react 16.5.1
💁 show a message to your users to upgrade Node instead of a stacktrace
please-upgrade-nodechecks if the users node version is statisfying the engines version in your package.json if not warns, uber useful for CLI apps relying on versions.
GET IT:npm install please-upgrade-node
Sample usage:
123
#!/usr/bin/env nodeconstpkg=require('./package.json')require('please-upgrade-node')(pkg)// <- Must run BEFORE requiring any other modules
in package.json:
12345
{"engines":{"node":">=6"}}
P.S: >= is the only operator supported.
You could also:
123456
pleaseUpgradeNode(pkg,{exitCode:0,// Default: 1message:function(requiredVersion){return'Oops this program require Node '+requiredVersion}})
worker threads into easy-to-use routines for CPU-bound.
microjob is a tiny wrapper for threads (worker_threads) and is intended to perform heavy CPU loads using anonymous functions.
GET IT:npm install microjob
Sample usage:
12345678910111213141516171819
(async () => {
const { job } = require('microjob')
try {
// this function will be executed in another thread
const res = await job(() => {
let i = 0
for (i = 0; i < 1000000; i++) {
// heavy CPU load ...
}
return i
})
console.log(res) // 1000000
} catch (err) {
console.error(err)
}
})();
P.S: To run this today, you we need node v>=10 and execute it via --experimental-worker flag.
commitizen prompts to fill out any required commit fields at commit time. No more waiting until later for a git commit hook to run and reject your commit or reading the contribution.md for the commit format!