Skip to content

Commit 6547370

Browse files
author
Łukasz Kleczaj
committed
bug fix: restore ability to turn on/of dev mode
1 parent 48af417 commit 6547370

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ out.info('lorem ipsum');
3131
dev.info('lorem ipsum');
3232

3333

34-
// activate/deactivate dev, .dev content is being display only if devOut===true
34+
// activate/deactivate dev, .dev content is being display only if dev mode is on
3535

36-
cli.devOut=true;
36+
cli.setDevMode(true);
3737
// --OR--
38-
cli.devOut=false;
38+
cli.setDevMode(false);
3939

4040

41-
// to apply color to string and display it later with other cli lib use this:
41+
// to apply color to string and display it later with another lib use this:
4242
cli.utils.apply_color('lorem ipsum', 'info');
4343

4444
var raw_text="lorem ipsum";

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ var core={
2424
}
2525
}
2626
module.exports={
27+
setDevMode:function("remote_devMode_val"){
28+
c_devOut=remote_devMode_val;
29+
return c_devOut;
30+
},
2731
devOut:{
2832
err:function (text,color){
2933
if(typeof color==="undefined") color='error';

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quick-cli",
3-
"version": "0.0.1",
3+
"version": "1.0.2",
44
"description": "Makes writing CLI code super easy and quick without losing flexibility.",
55
"main": "index.js",
66
"scripts": {
@@ -30,10 +30,5 @@
3030
"deasync": "^0.1.1",
3131
"inquirer": "^0.9.0"
3232
},
33-
"readme": "# Installation\n\n```bash\nnpm i quick-cli --save\n```\n\n# Usage\n\n```js\nvar cli = require('quick-cli');\n\n\n// choose meaning of your out text, quick-cli will apply colors\ncli.out('lorem ipsum', 'info');\ncli.out('lorem ipsum', 'form');\ncli.out('lorem ipsum', 'success');\ncli.out('lorem ipsum', 'warning');\ncli.out('lorem ipsum', 'error');\n\n\n// to display something only in dev/debug mode, use .dev instead of .out\ncli.out('lorem ipsum', 'info');\ncli.dev('lorem ipsum', 'info');\n\n\n// activate/deactivate dev, .dev content is being display only if devOut===true\n\ncli.devOut=true;\n// --OR--\ncli.devOut=false;\n\n\n// to apply color to string and display it later with other cli lib use this:\ncli.apply_color('lorem ipsum', 'info');\n\nvar raw_text=\"lorem ipsum\";\nvar colorful_text=cli.apply_color(raw_text, 'info');\n\nconsole.log(colorful_text); // both will display same\ncli.out(raw_text, 'info'); // way formatted text\n```\n",
34-
"readmeFilename": "README.md",
35-
"gitHead": "31f8196108d8d7c46fe185f5a64c7d30499c9572",
36-
"_id": "quick-cli@0.0.0",
37-
"_shasum": "0829815421c2aba33b1c729961ccf006915c1885",
38-
"_from": "quick-cli@*"
33+
"readmeFilename": "README.md"
3934
}

0 commit comments

Comments
 (0)