Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
guiferpa authored Oct 8, 2018
1 parent 73835d4 commit 29f700c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 29f700c

Please sign in to comment.