Skip to content

guiferpa/koala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koala

Build Status

What's it?

koala is a CLI that join separate files generating only one file as a bundler. Nowadays, others bundlers already exist, they are more complete like Webpack, but the idea of koala is to be simpler and generic

Install

  • Download from releases.

  • Install manually, need Go (no specific version)

> git clone git@github.com:guiferpa/koala.git
> cd ./koala && make

⚠️ When you run make the koala will be installed at $GOPATH/bin

Get started

koala needs that you input an entrypoint to itself work and the entrypoint is just a file that koala will read like a hub to call others files, follow the sample of one entry file named as ./entry.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.

include lib/hello.js

Now, look the external file at ./lib/hello.js where the koala named it as library, follow the sample below.

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 together.

'use strict';

function hello(name) {
  console.log(`Hello, ${name}`);
}

hello("Koala")
> 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