From 29f700cf689e418e71a997cec54204e4a554c933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Paix=C3=A3o?= Date: Mon, 8 Oct 2018 16:42:58 -0300 Subject: [PATCH] Update README.md --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 761044f..c4260ee 100644 --- a/README.md +++ b/README.md @@ -1 +1,43 @@ # koala + +### Whats's it? +**koala** is a CLI that join separate files generating only one file as a bundler. Nowadays already exists others bundlers more complete like the [Webpack](https://github.com/webpack/webpack) but the idea of **koala** is to be most simple and generic. + +### Get started +**koala** need that you input an entrypoint to itself work and the entrypoint is just a file that **koala** will be to read like a hub to call others files, follow the sample of one entry file named as `./entry.js`. +```js +'use strict'; + +include lib/hello.js + +hello("Koala"); +``` + +The entry file above is used to find out the targets that is just the line of entry file prefixed with a tag, see the example below where the tag is named as `include`. +```js +include lib/hello.js +``` +Now look the external file at `./lib/hello` where the koala named it as library, follow the sample below. + +```js +function hello(name) { + console.log(`Hello, ${name}`); +} +``` +Now look the output file at `./bin/out.js` and execute, this example execute the **koala** and [node.js](https://github.com/nodejs/node) together. +```js +'use strict'; + +function hello(name) { + console.log(`Hello, ${name}`); +} + +hello("Koala") +``` + +```sh +> koala ./entry.js ./bin/out.js include && node ./bin/out.js + +2018/10/08 15:53:13 spelled successfully 104 bytes at /Users/user/remote/username/repo/bin/out.js +Hello, Koala +```