-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
45 lines (41 loc) · 1007 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const npm = require("./");
// 200 ok pattern about 'stat' method
npm
.stat("npm-stats-api", "2022-01-01", "2022-02-15")
.then(res => {
console.log("\n# ok pattern about stat method");
console.log(res);
})
.catch(err => {
console.log(err);
});
// 200 ok pattern about 'details' method
npm
.details("npm-stats-api")
.then(res => {
console.log("\n# ok pattern about stat method");
console.log(res);
})
.catch(err => {
console.log(err);
});
// date format error pattern about 'stat' method
npm
.stat("npm-stats-api", "hoge", "2022-02-15")
.then(res => {
console.log("\n# date format error pattern about stat method");
console.log(res);
})
.catch(err => {
console.log(err);
});
// not found error pattern about 'details' method
npm
.stat("abcdefghijk", "2019-01-01", "2022-02-15")
.then(err => {
console.log("\n# not found error pattern about details method");
console.log(err);
})
.catch(err => {
console.log(err);
});