Gathering detailed insights and metrics for geckoboard
Gathering detailed insights and metrics for geckoboard
Gathering detailed insights and metrics for geckoboard
Gathering detailed insights and metrics for geckoboard
npm install geckoboard
Typescript
Module System
Node Version
NPM Version
73.5
Supply Chain
99.4
Quality
79.6
Maintenance
100
Vulnerability
100
License
TypeScript (99.16%)
JavaScript (0.84%)
Total Downloads
634,845
Last Day
6
Last Week
766
Last Month
3,317
Last Year
54,886
2 Stars
122 Commits
1 Forks
16 Watchers
4 Branches
21 Contributors
Updated on Nov 22, 2023
Latest Version
2.0.2
Package Id
geckoboard@2.0.2
Unpacked Size
85.20 kB
Size
16.56 kB
File Count
17
NPM Version
8.18.0
Node Version
18.8.0
Published on
Nov 23, 2023
Cumulative downloads
Total Downloads
Last Day
-45.5%
6
Compared to previous day
Last Week
-4%
766
Compared to previous week
Last Month
6.8%
3,317
Compared to previous month
Last Year
2.4%
54,886
Compared to previous year
For users of the deprecated custom widget library
You should pin your
package.json
to version0.0.9
of this module to ensure that your code continues to work.
npm install geckoboard@0.0.9 --save
npm install geckoboard
The latest documentation and user guide can be found on the Geckoboard developer docs (https://developer.geckoboard.com/)
import { Geckoboard } from 'geckoboard';
const API_KEY = 'YOUR_API_KEY';
const gb = new Geckoboard(API_KEY);
const dataset = gb.defineDataset({
id: 'my.dataset',
fields: {
count: {
type: 'number',
name: 'Count',
},
day: {
type: 'date',
name: 'Day',
},
timestamp: {
type: 'datetime',
name: 'Timestamp',
},
},
uniqueBy: ['day'],
});
await dataset.create();
await dataset.append([
{ count: 1, day: '2023-10-10' },
{ count: 2, day: '2023-10-11' },
{ count: 3, day: '2023-10-12' },
{ count: 4, day: '2023-10-13' },
]);
// provide an optional 'delete_by' value, to indicate
// which fields should be used to indicate which records
// should be deleted
await dataset.append([{ count: 3, day: '2023-10-11' }], 'day')
// all current data will be replaced
await dataset.replace([{ count: 2, day: '2023-10-10' }])
// remove the dataset completely
await dataset.delete()
await dataset.append([
{ count: 1, day: new Date('2023-10-10T12:00:00Z') },
{ count: 2, day: new Date('2023-10-11T12:00:00Z') },
{ count: 3, day: new Date('2023-10-12T12:00:00Z') },
{ count: 4, day: new Date('2023-10-13T12:00:00Z') },
]);
This will store the respective dataset field values as whatever the UTC value of the given Date object is.
// be careful with timezones, the date that is sent to the server
// will be the UTC value of the given date.
await dataset.append([
{
timestamp: new Date('2018-01-01T12:00:00'),
// If local timezone is GMT, this will map to '2018-01-01T12:00:00.000Z'
// If local time zone is `Europe/Paris` (UTC + 1), this will map to
// 2018-01-01T11:00:00.000Z
steps: 819,
},
]);
// local time will be changed to UTC
await dataset.append([
{
timestamp: new Date('2018-01-01T12:00'), // local time maps to UTC
// so for example, if you're in `Europe/Paris` (UTC + 1) this will be
// '2018-01-01T11:00:00.000Z' - it changes 12 noon back to 11am.
steps: 819,
},
]);
// dates with non-UTC timezone
await dataset.append([
{
timestamp: new Date('2013-09-15T05:53:00+08:00'),
// UTC + 8 time maps to UTC. So, this will map to
// '2013-09-14T21:53:00.000Z' - it goes back 8 hours, and changes
// the day, if necessary.
steps: 819,
},
]);
// date strings are always interpreted as UTC
// this is a quirk in the Javascript spec
await dataset.append([
{
timestamp: ...,
day: new Date('2013-09-15'),
// will always map to '2013-09-15'
// regardless of your timezone.
steps: 819,
},
]);
import { Geckoboard } from 'geckoboard';
const API_KEY = 'YOUR_API_KEY';
const gb = new Geckoboard(API_KEY);
try {
await gb.ping()
console.log("success")
} catch (err) {
console.log(err);
}
npm run test
You can change the host against which requests will be made by setting the GECKOBOARD_API_HOST
environment variable to the full URL of the instance you wish to use.
To publish a new version of the module to NPM, you need to run the following command
npm version X.X.X
Where X.X.X is the version you want to release. This will create a tagged commit, once this commit is pushed to github, it will trigger publishing to NPM.
No vulnerabilities found.