@senx/warp10
Advanced tools
Comparing version 1.1.4 to 2.0.0
{ | ||
"name": "@senx/warp10", | ||
"version": "1.1.4", | ||
"version": "2.0.0", | ||
"private": false, | ||
@@ -30,6 +30,36 @@ "keywords": [ | ||
"build": "tsc", | ||
"typedoc": "typedoc --options typedoc.json --plugin typedoc-plugin-markdown --hideGenerator src/*/*", | ||
"test": "mocha --require ts-node/register --ui bdd ./tests/unitTest1.ts", | ||
"eslint": "eslint -c .eslintrc.js --format html -o ./out/lint/eslint.html src/**/*.ts" | ||
"doc": "typedoc --options typedoc.json --plugin typedoc-plugin-markdown --hideGenerator src/*/*", | ||
"lint": "eslint -c .eslintrc.js --format html -o ./out/lint/eslint.html src/**/*.ts", | ||
"cl": "node changelog.js > CHANGELOG.md", | ||
"clean": "rm -fr ./out && rm -fr ./dist", | ||
"prepublishOnly": "yarn clean && yarn build", | ||
"test": "nyc mocha" | ||
}, | ||
"mocha": { | ||
"ui": "mocha-typescript", | ||
"slow": "2000", | ||
"spec": "tests/**/*.tests.ts", | ||
"require": [ | ||
"source-map-support/register", | ||
"ts-node/register" | ||
], | ||
"sort": false | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"exclude": [ | ||
"**/*.d.ts" | ||
], | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"reporter": [ | ||
"html" | ||
], | ||
"all": true, | ||
"report-dir": "./out/coverage" | ||
}, | ||
"homepage": "https://www.warp10.io", | ||
@@ -42,3 +72,3 @@ "author": "SenX <contact@senx.io>", | ||
"@types/mocha": "^10.0.3", | ||
"@types/node": "^20.8.7", | ||
"@types/node": "^20.8.8", | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
@@ -50,2 +80,6 @@ "@typescript-eslint/parser": "^6.8.0", | ||
"mocha": "^10.2.0", | ||
"mocha-typescript": "^1.1.17", | ||
"nyc": "^15.1.0", | ||
"semver-sort": "^1.0.0", | ||
"source-map-support": "^0.5.21", | ||
"ts-node": "^10.9.1", | ||
@@ -52,0 +86,0 @@ "typedoc": "^0.25.2", |
@@ -12,2 +12,3 @@ [](https://badge.fury.io/js/%40senx%2Fwarp10) | ||
npm i @senx/warp10 | ||
yarn add @senx/warp10 | ||
@@ -22,3 +23,3 @@ ## Dates and formats | ||
- fulltext | ||
- json (default) | ||
- json | ||
- tsv | ||
@@ -28,2 +29,3 @@ - fulltsv | ||
- raw | ||
- formatted (a json format, default) | ||
@@ -34,3 +36,5 @@ ## Usage sample | ||
import {Warp10} from "@senx/warp10"; | ||
import * as moment from 'moment'; | ||
import dayjs from "dayjs"; | ||
import utc from "dayjs/plugin/utc"; | ||
dayjs.extend(utc); | ||
@@ -40,4 +44,6 @@ const writeToken = 'xxxxxx'; | ||
const readToken = 'xxxx'; | ||
const w10 = new Warp10('https://sandbox.senx.io'); | ||
const w10 = new Warp10().endpoint('https://sandbox.senx.io'); | ||
// or const w10 = new Warp10({endpoint: 'https://sandbox.senx.io'}); | ||
const test = async () => { | ||
@@ -49,7 +55,7 @@ | ||
// fetch raw data between 2 dates | ||
console.log(await w10.fetch(readToken, '~io.warp10.*', {}, '2019-11-11T12:34:43.388409Z', '2019-11-21T12:34:43.388409Z', 'json')); | ||
console.log(await w10.fetch(readToken, '~io.warp10.*', {}, '2019-11-11T12:34:43.388409Z', dayjs().toISOString())); | ||
// insert data points | ||
console.log(await w10.update(writeToken, [ | ||
{timestamp: moment.utc().valueOf() * 1000, className: 'io.warp10.test', labels: {key: 'value'}, value: 54}, | ||
{timestamp: dayjs().utc().valueOf() * 1000, className: 'io.warp10.test', labels: {key: 'value'}, value: 54}, | ||
'1380475081000000// io.warp10.test{key=value} T', | ||
@@ -67,6 +73,6 @@ '1566893344654882/48.81:-4.147/124 io.warp10.test{key=value} [8.2 151 152 1568189745655509/40.6:-74/14 ]', | ||
// Fetch data with a time span | ||
console.log(await w10.fetch(readToken, '~.*', {}, '2019-11-21T12:34:43.388409Z', 86400000000 * 5)); | ||
console.log(await w10.fetch(readToken, '~.*', {}, dayjs().toISOString(), 86400000000 * 5)); | ||
// delete data between 2 dates | ||
console.log(await w10.delete(deleteToken, '~io.warp10.test*', {key: 'value'}, '2019-11-11T12:34:43.388409Z', '2019-11-21T12:34:43.388409Z')); | ||
console.log(await w10.delete(deleteToken, '~io.warp10.test*', {key: 'value'}, '2019-11-11T12:34:43.388409Z', dayjs().toISOString())); | ||
@@ -73,0 +79,0 @@ // delete all |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
43717
13
734
80
19
4