minimal-text-node v0.0.1
Minimal Text Nodes
Factory for creating minimal text nodes.
Installation
$ npm install minimal-text-node --saveUsage
To create a new text node,
var createTextNode = require( 'minimal-text-node' );
var text = createTextNode();The text instance has the following methods...
text.content( content )
This method is a setter/getter. If no content is provided, returns the text content. To set the text content
text.content( 'beep' );Note: setting new content will replace any existing content.
text.append( content )
This is a convenience method for appending new content to existing content. 
// Inconvenient...
text.content( text.content()+'boop' );
// Convenient...
text.append( 'boop' );text.toString()
Serializes the node as a string; i.e., returns the text content. 
text.toString();This method provides a consistent interface with minimal elements.
Examples
var text = createTextNode();
text.content( 'beep' );
for ( var i = 0; i < 10; i++ ) {
	text.append( '!' );
}
console.log( text.toString() );
// Returns 'beep!!!!!!!!!!'To run the example code from the top-level application directory,
$ node ./examples/index.jsTests
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 testAll 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-covIstanbul creates a ./reports/coverage directory. To access an HTML version of the report,
$ open reports/coverage/lcov-report/index.htmlLicense
Copyright
Copyright © 2014. Athan Reines.