0.0.7 • Published 8 years ago

codements v0.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

codements

MIT License Code Climate NPM Downloads NPM Dependencies Code Documentation

Node.js/JavaScript library to align code & comments.

Installation

Basic: npm install codements

As Dependency: npm install codements --save

Require in Node: var codements = require('codements');

What is this even useful for?

It's useful for generation of human-readable code. I personally use it in this Dota 2 Autoexec Generator.

codements.SplitView

Creates this type of codement:

var lineOfCode = true; // boolean variable
function test () {     // I know you don't actually like writing unit-tests
  return 'nope';       // neither do I
}                      // I wonder if anybody does
                       // comment overflow
[a,b] = [b,a];         // swapping pointless variables in ES6

Example

var codements = require('codements');

var parser = new codements.SplitView();
parser.addLine('var lineOfCode = true;', 'boolean variable');
parser.addLine('function test () {\n  return \'nope\';\n}', 'I know you don\'t actually like writing unit-tests\nneither do I\nI wonder if anybody does\ncomment overflow');
parser.addLine('[a,b] = [b,a];', 'swapping pointless variables in ES6');

console.log(parser.render());
0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago