-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a87f386
commit 2b4f3f5
Showing
22 changed files
with
1,204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
for the pretty version, see [compromise.cool/docs](http://compromise.cool/docs) | ||
|
||
this is the json version of the docs, which are run [as part of the unit tests](../tests/unit/docs/docs.test.js) | ||
this ensures that the docs stay somewhat up-to-date |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
var benchmark = require('./lib/benchmark'); | ||
var fs = require('fs'); | ||
var chalk = require('chalk'); | ||
|
||
var redGreen = function(last, now, unit) { | ||
var diff = (now - last).toFixed(2); | ||
var percent = diff / last * 100; | ||
percent = parseInt(percent, 10); | ||
if (percent < 0) { | ||
console.log(' ' + chalk.green(' ' + percent + '% ' + diff + ' ' + unit)); | ||
} else if (percent === 0) { | ||
console.log(' ' + chalk.yellow(' ' + percent + '% ' + diff + ' ' + unit)); | ||
} else { | ||
console.log(' ' + chalk.red('+' + percent + '% ' + diff + ' ' + unit)); | ||
} | ||
console.log(''); | ||
}; | ||
|
||
var compare = function(obj) { | ||
console.log(''); | ||
var last = JSON.parse(fs.readFileSync('./scripts/lib/log.json')); | ||
console.log(' size:'); | ||
redGreen(last.size, obj.size, 'kb'); | ||
console.log(' init:'); | ||
redGreen(last.init, obj.init, 'ms'); | ||
console.log(' parse:'); | ||
redGreen(last.big, obj.big, 'ms'); | ||
}; | ||
|
||
benchmark(obj => { | ||
compare(obj); | ||
// console.log(JSON.stringify(obj, null, 2)); | ||
// fs.writeFileSync('./scripts/lib/log.json', out); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var exec = require('shelljs').exec; | ||
var browserifyGlob = '"./node_modules/.bin/browserify-glob"'; | ||
var fileServer = '"./node_modules/.bin/http-server"'; | ||
|
||
//run tests on the client-side | ||
var out = './test/client/compiled_tests.js'; | ||
var cmd = browserifyGlob + ' "./test/unit/**/*.test.js" '; | ||
cmd += ' -t [ babelify --presets [ env ]] > ' + out; | ||
cmd += ' && ' + fileServer + ' test/client -o -c-1'; | ||
exec(cmd); | ||
|
||
//then cleanup that god-awful file in our sourcecode | ||
// exec('rm ' + out); | ||
|
||
|
||
//es5 main (browserify + derequire) | ||
// cmd = lib.browserify + ' "./src/index.js" --standalone nlp'; | ||
// cmd += ' | ' + lib.derequire; | ||
// cmd += ' >> ' + path.es5; | ||
// exec(cmd); |
Oops, something went wrong.