move to native esm
master
Kebler Network System Administrator 2021-04-24 18:36:55 -07:00
parent cf7e5a5201
commit dff29779f0
4 changed files with 18 additions and 19 deletions

View File

@ -1,11 +1,12 @@
{
"name": "@uci-utils/byte",
"version": "0.2.3",
"version": "0.3.0",
"description": "Byte Class and related functions",
"main": "src/byte.js",
"type": "module",
"scripts": {
"test": "./node_modules/.bin/mocha -r esm --timeout 30000",
"testd": "UCI_ENV=dev ./node_modules/.bin/nodemon --exec './node_modules/.bin/mocha -r esm --timeout 30000' || exit 0",
"test": "./node_modules/.bin/mocha --timeout 30000",
"testd": "UCI_ENV=dev ./node_modules/.bin/nodemon --exec './node_modules/.bin/mocha --timeout 30000' || exit 0",
"testdd": "UCI_LOG_LEVEL='trace' npm run testd",
"testde": "UCI_LOG_LEVEL='warn' npm run testd",
"testl": "UCI_ENV=pro UCI_LOG_PATH=./test/test.log 0 npm run test || exit 0"
@ -28,13 +29,12 @@
},
"homepage": "https://github.com/uCOMmandIt/uci-utils#readme",
"dependencies": {
"@uci-utils/logger": "^0.0.15",
"bitwise": "^2.0.3"
"@uci-utils/logger": "^0.1.0",
"bitwise": "^2.1.0"
},
"devDependencies": {
"chai": "^4.2.0",
"esm": "^3.2.25",
"mocha": "^6.2.0",
"nodemon": "^1.19.1"
"chai": "^4.3.4",
"mocha": "^8.3.2",
"nodemon": "^2.0.7"
}
}

View File

@ -1,12 +1,11 @@
// third party modules
import bits from 'bitwise/bits'
import toBits from 'bitwise/string/to-bits'
import readUInt from 'bitwise/buffer/read-u-int'
import createBuffer from 'bitwise/buffer/create'
import readByte from 'bitwise/byte/read'
import writeByte from 'bitwise/byte/write'
import bits from 'bitwise/bits/index.js'
import { toBits } from 'bitwise/string/index.js'
import { readUInt } from 'bitwise/buffer/index.js'
import { create as createBuffer } from 'bitwise/buffer/index.js'
import { read as readByte, write as writeByte } from 'bitwise/byte/index.js'
//local
import * as array from './array'
import * as array from './array.js'
import logger from '@uci-utils/logger'

View File

@ -2,7 +2,7 @@ let date = new Date(Date.now())
console.log('run:', date.getMinutes(), ':', date.getSeconds())
import { expect } from 'chai'
import * as _ from '../src/array'
import * as _ from '../src/array.js'
describe('Array Library - ', function () {

View File

@ -2,7 +2,7 @@ let date = new Date(Date.now())
console.log('run:', date.getMinutes(), ':', date.getSeconds())
import { expect } from 'chai'
import * as _ from '../src/byte'
import * as _ from '../src/byte.js'
describe('Byte Library - ', function () {
@ -21,7 +21,7 @@ describe('Byte Library - ', function () {
// console.log('input', ifmt, byte)
_.BYTE_FORMATS.forEach((ofmt, o) => {
fmt.out = ofmt
// console.log(fmt.out, _.byteFormat(byte, fmt))
// console.log('output', fmt.out, _.byteFormat(byte, fmt))
expect(_.byteFormat(byte, fmt)).deep.equal(results[o])
})
})