Skip to content

Commit 930519f

Browse files
committed
Merge branch 'master' of github.com:guiferpa/koala
2 parents 389eb9a + 29f700c commit 930519f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
11
# koala
2+
3+
### Whats's it?
4+
**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.
5+
6+
### Get started
7+
**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`.
8+
```js
9+
'use strict';
10+
11+
include lib/hello.js
12+
13+
hello("Koala");
14+
```
15+
16+
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`.
17+
```js
18+
include lib/hello.js
19+
```
20+
Now look the external file at `./lib/hello` where the koala named it as library, follow the sample below.
21+
22+
```js
23+
function hello(name) {
24+
console.log(`Hello, ${name}`);
25+
}
26+
```
27+
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.
28+
```js
29+
'use strict';
30+
31+
function hello(name) {
32+
console.log(`Hello, ${name}`);
33+
}
34+
35+
hello("Koala")
36+
```
37+
38+
```sh
39+
> koala ./entry.js ./bin/out.js include && node ./bin/out.js
40+
41+
2018/10/08 15:53:13 spelled successfully 104 bytes at /Users/user/remote/username/repo/bin/out.js
42+
Hello, Koala
43+
```

0 commit comments

Comments
 (0)