4.0.5 • Published 1 year ago

c2h6o v4.0.5

Weekly downloads
4
License
ISC
Repository
-
Last release
1 year ago

CLI tools for node developing or console debugging

In current version there are several components inside this package:

clipp: A cli param parser

Clip is a class, you can use it to define arguments, and then get theirs value by parsing a string which formatted like shell command syntax. Usage:

import { co, Clip } from 'c2h6o';
import { format } from './extractor';

const clip = new Clip([
    {
        'names': ['config', 'c'],
        'description': 'Specify custom config file',
        'optional': true,
    },
    {
        'names': ['file', 'f'],
        'description': 'Input file',
        'optional': false,
    },
    {
        'names': ['pattern', 'p'],
        'optional': true,
        
    },
    {
        'names': ['output', 'o'],
        'description': 'Output file',
        'optional': true,
        // 'default': ''
    }
]).parse(process.argv);

// Check if required entry provided and comform with `validator`'s rule
// this action can be omitted
clip.audit();

console.log(clip.getValue('config'));

co: Tools to colorize output texts

co is an object like console.

the common log method takes values with colorize gramma to paint the output string.

It now ONLY suppts 256color shell or web-developer-tools console evironments.

Colorizing gramma:

co.log('Color #[f00]red#[] or #[00f]blue#[] string.');

co is also a function which returns the formatted string instead of outputing

const costr = co('#[f00]A red string');
4.0.5

1 year ago

4.0.4

1 year ago

4.0.3

2 years ago

4.0.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.4

3 years ago

2.0.7

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.5

3 years ago

2.0.6

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0-2

5 years ago

1.0.0-1

5 years ago

1.0.0

5 years ago