dashattach 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # DashAttach
2
+ Dashattach - library for interacting with the Dash API.
3
+ Last version: 0.0.2
4
+ npm: https://www.npmjs.com/package/dashattach
5
+
6
+ Installing - `npm i dashattach`
7
+
8
+ # Import
9
+ ```JavaScript (ESM)
10
+ import DashAttach from "dashattach"
11
+ ```
package/index.js CHANGED
@@ -5,8 +5,8 @@ import info from "./src/components/information.js"
5
5
  import actions from "./src/components/actions.js"
6
6
 
7
7
  const DashAttach = {
8
- featuredProjects: async () => {
9
- const result = await (await fetch("https://dashblocks.org/featured-projects")).json()
8
+ featuredProjects: async (offset, limit) => {
9
+ const result = await (await fetch(`https://api.dashblocks.org/featured-projects?offset=${+offset || 0}&limit=${+limit || 5}`)).json()
10
10
  return result
11
11
  },
12
12
  auth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashattach",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Library for interacting with the Dash API.",
5
5
  "homepage": "https://github.com/shaman2016scratch/DashAttach",
6
6
  "bugs": {
@@ -12,9 +12,9 @@
12
12
  },
13
13
  "license": "GPL-3.0",
14
14
  "author": "polzovatel_8787",
15
- "type": "commonjs",
15
+ "type": "module",
16
16
  "main": "index.js",
17
17
  "scripts": {
18
- "test": "echo \"Error: no test specified\" && exit 1"
18
+ "test": "node test.js"
19
19
  }
20
20
  }
package/test.js ADDED
@@ -0,0 +1,9 @@
1
+ import DashAttach from "./index.js";
2
+
3
+ console.log(await DashAttach.info.users.getRole(7))
4
+ console.log(await DashAttach.info.users.getGradient(7))
5
+ console.log(await DashAttach.info.users.getId(7))
6
+ console.log(await DashAttach.info.users.getUsername(7))
7
+ console.log(await DashAttach.info.projects.getAuthorUsername(100))
8
+ console.log(await DashAttach.featuredProjects(0, 10))
9
+ console.log(await DashAttach.auth.myInfo.isLogin())