0.7.1 • Published 7 years ago

erudite v0.7.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Erudite

A tool that parses and executes JavaScript from Markdown, akin to Literate CoffeeScript. Check out the annotated source or the docs below.

Getting Started

npm install -g erudite

CLI Usage

Usage: erudite [options] /path/to/filename

  -h, --help     show this help text
  -o, --outfile  write to the given file path
  -e, --stage    ECMAScript proposal stage (0-4)
      --stdout   write to stdout (ignores -o)

API Usage

erudite exports a single function which parses and executes a given buffer of Markdown text:

var fs = require('fs');
var erudite = require('erudite');

var filename = './literate-javascript.md';
var text = fs.readFileSync(filename, 'utf8');

erudite(text, {
  filename: filename
});

You can also parse and execute separately:

var source = erudite.parse(buf);
erudite.exec(source, opts);

erudite.parse(text, opts)

  • text A string of Markdown text to process
  • opts A configuration object
    • eol (Optional) The string to use to concatenate code blocks (defaults to os.EOL)

erudite.exec(src, opts)

  • src A string of JavaScript source code
  • opts A configuration object
    • filename (Optional) The name of the source file (defaults to erudite)

License

MIT

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago