diff --git a/samples/package.json b/samples/package.json index eeac367..c58bfdd 100644 --- a/samples/package.json +++ b/samples/package.json @@ -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", diff --git a/samples/ts/main.chalk.ts b/samples/ts/main.chalk.ts new file mode 100644 index 0000000..76bfef8 --- /dev/null +++ b/samples/ts/main.chalk.ts @@ -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%')} +`); + \ No newline at end of file diff --git a/samples/ts/main.ts b/samples/ts/main.ts index 4612e94..a1e9fe9 100644 --- a/samples/ts/main.ts +++ b/samples/ts/main.ts @@ -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'; @@ -46,7 +46,6 @@ let async_start = async () => { marked_test(); print( await promise_test() ); - //print( chalk.blue( "HELLO WORLD!") ); }