Skip to content

Commit

Permalink
add chalk support
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jun 12, 2019
1 parent 3ae1fc1 commit 85c444b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"typescript": "^3.3.4000"
},
"scripts": {
"build:chalk": "parcel build ts/main.chalk.ts --target=node --bundle-node-modules --no-source-maps --no-minify -d ./target/js -o main.js",
"build:main": "parcel build ts/main.ts --target=node --bundle-node-modules --no-source-maps --no-minify -d ./target/js",
"build:main2": "parcel build ts/main.ts --no-source-maps --no-minify -d ./target/js",
"start:graaljs": "mvn -f graaljs-pom.xml exec:exec",
Expand Down
25 changes: 25 additions & 0 deletions samples/ts/main.chalk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import chalk from 'chalk';

const msg = 'HELLO WORLD!';

console.log(
`
${chalk.blue(msg)}
${chalk.inverse(msg)}
${chalk.blue.bgRed.bold(msg)}
${chalk.blue.underline.bold(msg)}
`
);

const error = chalk.bold.red;
const warning = chalk.keyword('orange');

console.log(error('Error!'));
console.log(warning('Warning!'));

console.log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);

3 changes: 1 addition & 2 deletions samples/ts/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import chalk from 'chalk';

import { test as future_test } from './future.test';
import { MemoryType, Optional, URI } from './j2ts/jdk8-types';
import { test as marked_test } from './marked.test';
Expand Down Expand Up @@ -46,7 +46,6 @@ let async_start = async () => {
marked_test();
print( await promise_test() );

//print( chalk.blue( "HELLO WORLD!") );
}


Expand Down

0 comments on commit 85c444b

Please sign in to comment.