booru 2.7.0 → 2.8.0
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/LICENSE.md +1 -1
- package/dist/Constants.d.ts +1 -0
- package/dist/Constants.d.ts.map +1 -1
- package/dist/Constants.js +11 -5
- package/dist/Constants.js.map +1 -1
- package/dist/Utils.d.ts +10 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +38 -4
- package/dist/Utils.js.map +1 -1
- package/dist/boorus/Booru.d.ts +29 -0
- package/dist/boorus/Booru.d.ts.map +1 -1
- package/dist/boorus/Booru.js +84 -3
- package/dist/boorus/Booru.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/sites.json +24 -12
- package/dist/structures/SearchResults.d.ts.map +1 -1
- package/dist/structures/SearchResults.js.map +1 -1
- package/dist/structures/SiteApi.d.ts +2 -0
- package/dist/structures/SiteApi.d.ts.map +1 -1
- package/dist/structures/SiteApi.js.map +1 -1
- package/dist/structures/Tag.d.ts +42 -0
- package/dist/structures/Tag.d.ts.map +1 -0
- package/dist/structures/Tag.js +52 -0
- package/dist/structures/Tag.js.map +1 -0
- package/dist/structures/TagListParameters.d.ts +14 -0
- package/dist/structures/TagListParameters.d.ts.map +1 -0
- package/dist/structures/TagListParameters.js +7 -0
- package/dist/structures/TagListParameters.js.map +1 -0
- package/dist/structures/TagListResults.d.ts +53 -0
- package/dist/structures/TagListResults.d.ts.map +1 -0
- package/dist/structures/TagListResults.js +73 -0
- package/dist/structures/TagListResults.js.map +1 -0
- package/package.json +14 -15
- package/readme.md +22 -5
package/readme.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> _A node package to search boorus_
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
  
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Only [non-EoL](https://nodejs.org/en/about/previous-releases) versions of Node.js are tested and officially supported. EoL versions are unsupported. Other runtimes (like web, Deno, and Bun) aren't _officially_ supported but issues and PRs are accepted for them.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
```sh
|
|
26
26
|
npm add booru
|
|
27
27
|
# or
|
|
28
|
+
pnpm add booru
|
|
29
|
+
# or
|
|
28
30
|
yarn add booru
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -33,6 +35,18 @@ yarn add booru
|
|
|
33
35
|
## Usage
|
|
34
36
|
|
|
35
37
|
```js
|
|
38
|
+
import { search, forSite } from 'booru'
|
|
39
|
+
|
|
40
|
+
const posts = await search('safebooru', ['glaceon'], {
|
|
41
|
+
limit: 3,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
for (const post of posts) {
|
|
45
|
+
console.log(post.fileUrl, post.postView)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Or, using alias support and creating
|
|
49
|
+
|
|
36
50
|
const Booru = require('booru')
|
|
37
51
|
|
|
38
52
|
Booru.search('safebooru', ['glaceon'], { limit: 3, random: true }).then(
|
|
@@ -42,9 +56,9 @@ Booru.search('safebooru', ['glaceon'], { limit: 3, random: true }).then(
|
|
|
42
56
|
)
|
|
43
57
|
|
|
44
58
|
// or (using alias support and creating boorus)
|
|
45
|
-
const sb =
|
|
59
|
+
const sb = forSite('sb')
|
|
46
60
|
|
|
47
|
-
sb.search(['cat', 'dog'], { limit: 2 })
|
|
61
|
+
const petPosts = await sb.search(['cat', 'dog'], { limit: 2 })
|
|
48
62
|
```
|
|
49
63
|
|
|
50
64
|
See [example.js](./example.js) for more examples
|
|
@@ -92,7 +106,7 @@ Derpibooru has `Safe, Suggestive, Questionable, Explicit`, although `Suggestive`
|
|
|
92
106
|
|
|
93
107
|
Sure! Just fork this repo, push your changes, and then make a PR.
|
|
94
108
|
|
|
95
|
-
I'll accept PR based on what they do
|
|
109
|
+
I'll accept PR based on what they do. Make sure your changes pass the lint (`pnpm run lint:fix`) and tests (`pnpm run test`).
|
|
96
110
|
|
|
97
111
|
### Why?
|
|
98
112
|
|
|
@@ -129,4 +143,7 @@ Why not?
|
|
|
129
143
|
|
|
130
144
|
> [Copy tags argument so it's not modified](https://github.com/AtoraSuunva/booru/pull/103)
|
|
131
145
|
|
|
146
|
+
[ColonelBologna](https://github.com/ColonelBologna)
|
|
147
|
+
|
|
148
|
+
> [Tag list](https://github.com/AtoraSuunva/booru/pull/114)
|
|
132
149
|
---
|