diff --git a/README.md b/README.md index 9ebf4cf..4c37bc6 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ console.log('It doesn`t matter') console.log('How \n many \n lines \n it uses') ``` -Or maybe, to show an flow process? +Or maybe, to show a flow process? ```javascript function someAsyncFunction(){ var TAG = '[someAsyncFunction]' @@ -106,9 +106,9 @@ You can create your own progress bar, just like "that": ```javascript require('draftlog').into(console) -// Input progess goes from 0 to 100 +// Input progress goes from 0 to 100 function ProgressBar(progress) { - // Make it 50 characters length + // Make it 50 characters long var units = Math.round(progress / 2) return '[' + '='.repeat(units) + ' '.repeat(50 - units) + '] ' + progress + '%' } @@ -145,7 +145,7 @@ automatically, because the stream is being "read". To stop your own code, you ca ## Discouragements -This library is awesome for development, `cli` tools and what ever you want to created, that is NOT an +This library is awesome for development, `cli` tools and whatever you want to create, that is NOT an optimized "slave" server. Please, disable it passing `true` as a second parameter to the DraftLog initialization: ```javascript diff --git a/examples/installer.js b/examples/installer.js index 845b58a..45ef0ab 100644 --- a/examples/installer.js +++ b/examples/installer.js @@ -4,8 +4,8 @@ const DraftLog = require('../').into(console) // Mock download var downloadMock = setInterval -// Shows an instalation log for a `library` on the `step` -function InstalationProgress(library, step, finished) { +// Shows an installation log for a `library` on the `step` +function InstallationProgress(library, step, finished) { var fillSpaces = ' '.repeat(15 - library.length) if (finished) { return chalk.cyan.dim(' > ') + chalk.yellow.dim(library) + fillSpaces + chalk.green('Installed') @@ -14,14 +14,14 @@ function InstalationProgress(library, step, finished) { } } -// Pretent do install stuff in series +// Pretend do install stuff in series var libs = ['async', 'lodash', 'mongodb', 'chalk', 'express', 'forever', 'socket.io', 'pm2', 'mocha'] var finished = false var installed = 0 function startNextDownload() { if (installed >= libs.length) { - // Finished! (logs once only) + // Finished! (logs only once) if (!finished) { console.log() console.log(chalk.green('Finished Installation.')) @@ -42,31 +42,31 @@ function startNextDownload() { function install(lib, callback) { var status = console.draft() - gatterDependencies() + gatherDependencies() - function gatterDependencies() { - status(InstalationProgress(lib, 'gatterDependencies')) + function gatherDependencies() { + status(InstallationProgress(lib, 'gatherDependencies')) // Wait 300ms before next step - setTimeout(function () {downloadDepeendencies()}, 100 + Math.random() * 200) + setTimeout(function () {downloadDependencies()}, 100 + Math.random() * 200) } - function downloadDepeendencies() { - status(InstalationProgress(lib, 'downloading dependencies')) + function downloadDependencies() { + status(InstallationProgress(lib, 'downloading dependencies')) // Wait 300ms before next step setTimeout(function () {compileCode()}, 150 + Math.random() * 200) } function compileCode() { - status(InstalationProgress(lib, 'compiling code')) + status(InstallationProgress(lib, 'compiling code')) // Wait 300ms before next step setTimeout(function () {finishUp()}, 50 + Math.random() * 200) } function finishUp() { - status(InstalationProgress(lib, 'finished', true)) + status(InstallationProgress(lib, 'finished', true)) callback() } } diff --git a/examples/loading.js b/examples/loading.js index b8562fe..f8e71ce 100644 --- a/examples/loading.js +++ b/examples/loading.js @@ -15,10 +15,10 @@ console.log() var updateLoading = console.draft() function loadingTest(){ - updateLoading(Loading('Inderteminate Loading...')) + updateLoading(Loading('Indeterminate Loading...')) } -// Keeps updating underteminate loading +// Keeps updating indeterminate loading var interval = setInterval(loadingTest, 100) var steps = ['Doing that', 'Then that', 'And after that', 'We will finish', 'In', '3', '2', '1'] diff --git a/examples/progress.js b/examples/progress.js index 717cb9e..d67828b 100644 --- a/examples/progress.js +++ b/examples/progress.js @@ -4,7 +4,7 @@ const DraftLog = require('../').into(console) // Mock download var downloadMock = setInterval -// Input progess goes from 0 to 100 +// Input progress goes from 0 to 100 function ProgressBar(progress) { // Make it 50 characters length progress = Math.min(100, progress) diff --git a/lib/LogDraft.js b/lib/LogDraft.js index c476868..367969f 100644 --- a/lib/LogDraft.js +++ b/lib/LogDraft.js @@ -34,7 +34,7 @@ LogDraft.prototype.update = function update(/* log arguments */) { // It can be rewritten, move line to current cursor line, and keep updating this.saveLine(-1) } else { - // Invalidate and prevent writting + // Invalidate and prevent writing this.valid = false return; } @@ -65,7 +65,7 @@ LogDraft.prototype.update = function update(/* log arguments */) { /* * Returns true if line is out of screen */ -LogDraft.prototype.isOffScreen = function isOffScren() { +LogDraft.prototype.isOffScreen = function isOffScreen() { var rows = this._stream.rows() || defaults.maximumLinesUp return this._stream.rows() <= this.linesUp() } diff --git a/lib/index.js b/lib/index.js index 165480d..f45e344 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,7 +3,7 @@ // Lib main object is 'into' method var Lib = require('./into') -// Expose injecter 'into' method +// Expose injector 'into' method Lib.into = Lib // Expose Defaults diff --git a/lib/into.js b/lib/into.js index daea666..176e8fd 100644 --- a/lib/into.js +++ b/lib/into.js @@ -4,9 +4,9 @@ const LogDraft = require('./LogDraft') const LineCountStream = require('./LineCountStream') /* - * Injects DrafLog into a console object - * call with a seccond parameter as 'true' to - * Mock instalation, and add only the `draft` method + * Injects DraftLog into a console object + * call with a second parameter as 'true' to + * Mock installation, and add only the `draft` method * as a alias to `console.log` */ module.exports = function into(console, extra) {