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

View File

@ -1,12 +1,11 @@
// third party modules // third party modules
import bits from 'bitwise/bits' import bits from 'bitwise/bits/index.js'
import toBits from 'bitwise/string/to-bits' import { toBits } from 'bitwise/string/index.js'
import readUInt from 'bitwise/buffer/read-u-int' import { readUInt } from 'bitwise/buffer/index.js'
import createBuffer from 'bitwise/buffer/create' import { create as createBuffer } from 'bitwise/buffer/index.js'
import readByte from 'bitwise/byte/read' import { read as readByte, write as writeByte } from 'bitwise/byte/index.js'
import writeByte from 'bitwise/byte/write'
//local //local
import * as array from './array' import * as array from './array.js'
import logger from '@uci-utils/logger' 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()) console.log('run:', date.getMinutes(), ':', date.getSeconds())
import { expect } from 'chai' import { expect } from 'chai'
import * as _ from '../src/array' import * as _ from '../src/array.js'
describe('Array Library - ', function () { describe('Array Library - ', function () {

View File

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