Generates code comments for a compute-io README.
$ npm install compute-fill-readme
var fill = require( 'compute-fill-readme' );
Asynchronously create code comments for a README.md
file in a specified directory
and insert them into the file.
fillReadme( 'path/to/a/directory', onCompletion );
function onCompletion( error ) {
if ( error ) {
throw error;
}
console.log( 'Success!' );
}
Synchronously create code comments for a README.md
file in a specified directory
and insert them into the file.
fillReadme.sync( 'path/to/a/directory' );
var fillReadme = require( 'compute-fill-readme' ),
fs = require( 'fs' );
fillReadme( './examples/sqrt', function onCompletion() {
fs.readFile( './examples/sqrt/README.md', 'utf-8', function onRead( error, file ) {
console.log( file );
});
});
To run the example code from the top-level application directory,
$ node ./examples/index.js
To use the module as a general utility, install the module globally
$ npm install -g compute-fill-readme
Usage: fillReadme [options] [directory]
Options:
-h, --help Print this message.
-V, --version Print the package version.
$ cd ~/my/project/directory
$ fillReadme
# => Generates code comments for the README.md file in the current working directory
To specify a location other than the current working directory, provide a directory
.
$ fillReadme ./../some/other/directory
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2015. The Compute.io Authors.