Skip to content

Commit

Permalink
Modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
kutyel committed Feb 28, 2019
1 parent 4ec7aa1 commit e7814be
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
############################
node_modules
npm-debug.log
package-lock.json

############################
# tmp, editor & OS files
Expand Down Expand Up @@ -31,3 +32,4 @@ coverage
# Other
############################
.node_history
dist
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: node_js
node_js:
- "node"
- "lts/*"
- 'node'
- 'lts/*'
before_script:
- npm run clean
script:
- npm run build
after_success: npm run coveralls
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict'

class Emitter {
export default class Emitter {
constructor (events = []) {
this.events = new Map(events)
}
Expand All @@ -14,5 +12,3 @@ class Emitter {
return this.events.has(name) && this.events.get(name).map(fn => fn(...args))
}
}

module.exports = Emitter
4 changes: 1 addition & 3 deletions index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict'

const Emitter = require('.')
import Emitter from '.'

describe('Emitter', () => {
let sub
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"description": "Smallest event emitter for JavaScript with all the power of ES6 Maps!",
"homepage": "https://documentup.com/kutyel/es6-emitter",
"version": "1.0.1",
"main": "index.js",
"main": "dist/es6-emitter.js",
"umd:main": "dist/es6-emitter.umd.js",
"module": "dist/es6-emitter.mjs",
"source": "index.js",
"author": {
"email": "flaviocorpa@gmail.com",
"name": "Flavio Corpa",
Expand All @@ -28,18 +31,22 @@
],
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "^6.24.1",
"coveralls": "latest",
"git-dirty": "latest",
"jest": "^22.0.0",
"lodash": "latest",
"merge": "latest",
"microbundle": "^0.10.1",
"prettier-standard": "latest",
"standard": "latest"
},
"engines": {
"node": ">= 6"
},
"scripts": {
"build": "microbundle -o dist",
"dev": "microbundle watch",
"clean": "rm -rf node_modules",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"lint": "standard",
Expand Down

0 comments on commit e7814be

Please sign in to comment.