0.0.3 • Published 10 years ago

acute v0.0.3

Weekly downloads
6
License
-
Repository
github
Last release
10 years ago

acute.js

The no strings attached JavaScript build solution.

This project is very much in its infancy. Feel free to contribute if you dig it!

Why?

Because organising your client side application shouldn't be a chore. acute.js let's you do it however you please, and build it with a single command.

How?

At its core, acute.js uses the /// import and /// export directives to describe a modules context in the project. The triple-slash comments allows acute.js modules to be incredibly portable.

The hello world! example demonstrates, pretty much, all the components of acute.js.

Getting Started

acute.js is best installed globally.

npm install -g acute

Now let's whip up a quick hello world! library to demonstrate acute.js's fool proof module system.

hello.js

/// exports foo.hello from bar;
var bar = 'hello';

First we create a namespace foo.hello and give it the object bar.

world.js

/// exports foo.world;
var world = 'world';

Now we create a namespace foo.world and it infers that it should receive the object world.

example.js

/// exports example;
/// imports foo.hello;
/// imports foo.world to bar;
var example = function() {
  console.log(hello + ' ' + bar + '!');
};

This will be our entry point. It creates a namespace example which infers the function we've defined and it also imports our namespaces foo.hello and foo.world. In this instance we've imported foo.world as bar.

So how do build this trivial little example? With an acute.json file of course!

acute.json

{
  "root": "./",
  "public": {
    "example": "foo"
  },
  "output": "./build.js"
}

So what is this telling us? Well assuming all our files are in the same directory, acute.json is going to instruct the compiler that all source files are located in the ./, this directory; it wants to make the namespace example publically accessible as window.foo, and finally; it wants to output the result to a file ./build.js. Now it's simply a matter of executing the acute.js compiler on the command line.

$ acute .

And voila! We now have a portable JavaScript hello world! library!

Programmatic API

If you decide you would like to use acute.js in your Gruntfile, or anything else, you can execute a build by requiring acute in your source code.

var $acute = require('acute');
$acute.make('./path/to/acute.json', function(err) {
  if (err) return console.log(err);
  console.log('All good man!');
);

Questions, Comments?

Feel free to email or submit an issue!

Contributing

To say acute.js is in its infancy would be an understatement. Please feel free to contribute by forkng this repository and issuing a pull request! Please maintain the coding style if you do!

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago