upgrade to esm from @std/esm

master
David Kebler 2018-05-16 07:12:14 -07:00
parent 002ad9edbb
commit 12143f58e4
7 changed files with 10 additions and 28 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/node_modules/
/coverage/
*.lock

View File

@ -1,13 +1,13 @@
{
"name": "@uci/interrupt",
"main": "src",
"version": "0.1.1",
"version": "0.1.4",
"description": "a class for adding interrupt processesing for gpio pins on Raspberry Pi and Similar SBCs",
"scripts": {
"single": "sudo node --require @std/esm examples/single",
"singlelog": "UCI_LOG=true sudo node_--require @std/esm examples/single | pino-colada",
"multi": "sudo node --require @std/esm examples/multi",
"multilog": "DEBUG=true sudo node --require @std/esm examples/multi"
"single": "sudo node -r esm examples/single",
"singlelog": "UCI_LOG=true sudo node -r esm examples/single | pino-colada",
"multi": "sudo node --require esm examples/multi",
"multilog": "DEBUG=true sudo node --require esmexamples/multi"
},
"author": "David Kebler",
"license": "MIT",
@ -31,15 +31,14 @@
},
"dependencies": {
"@uci/base": "^0.1.1",
"@uci/logger": "0.0.1",
"@uci/logger": "^0.0.2",
"lodash.debounce": "^4.0.8"
},
"@std/esm": "cjs",
"devDependencies": {
"@std/esm": "^0.22.0",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"codecov": "^3.0.0",
"esm": "^3.0.21",
"istanbul": "^0.4.5",
"mocha": "^5.0.1",
"nodemon": "^1.14.3",

View File

@ -8,15 +8,6 @@ import Base from '@uci/base'
import logger from '@uci/logger'
let log = {}
const LOG_OPTS = (id) => {
return {
repo:'uci-interrupt',
npm:'@uci/interrupt',
file:'src/interrupt.mjs',
class:'Interrupt',
id:id,
instance_created:new Date().getTime()
}}
export default class Interrupt extends Base {
constructor(pin,opts={}) {
@ -37,7 +28,7 @@ export default class Interrupt extends Base {
if (opts.sockets==='') throw ('must have at least one socket client')
super(opts)
console.dir(opts)
log = logger.child(LOG_OPTS(this.id))
log = logger({name:'interrupt',id:this.id})
log.info({pins:pin, opts:opts},'created interrupt with these opts')
this.pin_num = pin
this.mock = opts.mock

View File

@ -2,21 +2,13 @@ import Interrupt from './interrupt'
import logger from '@uci/logger'
let log = {}
const LOG_OPTS = (id) => {
return {
repo:'uci-interrupt',
npm:'@uci/interrupt',
file:'src/interrupts.mjs',
class:'Interrupts',
id:id,
instance_created:new Date().getTime()
}}
export default class Interrupts {
constructor(pins,opts={}) {
this.id = this.id || 'interrupts'
this.pins = pins
this.interrupt={}
log = logger({name:'interrupts',id:this.id})
pins.forEach (pin =>{
opts[pin] = opts[pin] || {}
opts[pin].id = (opts.id ||'interrupt') + ':' + pin;
@ -27,7 +19,6 @@ export default class Interrupts {
this.interrupt[pin].hook=hook
this.interrupt[pin].reply = () =>{}
})
log = logger.child(LOG_OPTS(this.id))
}
async init() {