Skip to content

compute-io/fill-readme

Repository files navigation

Fill Readme

NPM version Build Status Coverage Status Dependencies

Generates code comments for a compute-io README.

Installation

$ npm install compute-fill-readme

Usage

var fill = require( 'compute-fill-readme' );

fillReadme( directory[, clbk] )

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!' );
}

fillReadme.sync( dir )

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' );

Examples

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

CLI

Installation

To use the module as a general utility, install the module globally

$ npm install -g compute-fill-readme

Usage

Usage: fillReadme [options] [directory]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ 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

Tests

Unit

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.

Test Coverage

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

License

MIT license.

Copyright

Copyright © 2015. The Compute.io Authors.

About

Generate code comments for a Compute.io README.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published