Skip to content

Commit

Permalink
feat(package): Add support for older NodeJS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Jan 27, 2016
1 parent 0282856 commit 3f62554
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["es2015-node4", "stage-0"],
"presets": ["es2015"],
"plugins": ["add-module-exports"]
}
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ notifications:
email: true
node_js:
- stable
- 5
- 4
- 0.12
- 0.10
before_install:
- npm install -g npm@latest
before_script:
- npm prune
after_success:
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"devDependencies": {
"babel-cli": "6.4.5",
"babel-plugin-add-module-exports": "0.1.2",
"babel-preset-es2015-node4": "2.0.3",
"babel-preset-stage-0": "6.3.13",
"babel-preset-es2015": "6.3.13",
"chai": "3.4.1",
"coveralls": "2.11.6",
"cz-conventional-changelog": "1.1.5",
Expand Down
11 changes: 8 additions & 3 deletions src/messages/BaseMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const ASTRAL_REGEX = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
* @version 2.0.0
*/
export class BaseMessage {
_lines = [];
_config = {color: 'default', marginTop: 0, marginBottom: 0, printFn: process.stdout.write.bind(process.stdout)};

/**
* Creates new message instance.
*
Expand All @@ -37,6 +34,14 @@ export class BaseMessage {
* @param {Function} [config.printFn] Function that used to print transformed message
*/
constructor(lines, config) {
this._lines = [];
this._config = {
color: 'default',
marginTop: 0,
marginBottom: 0,
printFn: process.stdout.write.bind(process.stdout)
};

this.setLines(lines);
this.setConfig(config);
}
Expand Down

0 comments on commit 3f62554

Please sign in to comment.