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.
Files changed (37) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/Constants.d.ts +1 -0
  3. package/dist/Constants.d.ts.map +1 -1
  4. package/dist/Constants.js +11 -5
  5. package/dist/Constants.js.map +1 -1
  6. package/dist/Utils.d.ts +10 -2
  7. package/dist/Utils.d.ts.map +1 -1
  8. package/dist/Utils.js +38 -4
  9. package/dist/Utils.js.map +1 -1
  10. package/dist/boorus/Booru.d.ts +29 -0
  11. package/dist/boorus/Booru.d.ts.map +1 -1
  12. package/dist/boorus/Booru.js +84 -3
  13. package/dist/boorus/Booru.js.map +1 -1
  14. package/dist/index.d.ts +19 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +28 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/sites.json +24 -12
  19. package/dist/structures/SearchResults.d.ts.map +1 -1
  20. package/dist/structures/SearchResults.js.map +1 -1
  21. package/dist/structures/SiteApi.d.ts +2 -0
  22. package/dist/structures/SiteApi.d.ts.map +1 -1
  23. package/dist/structures/SiteApi.js.map +1 -1
  24. package/dist/structures/Tag.d.ts +42 -0
  25. package/dist/structures/Tag.d.ts.map +1 -0
  26. package/dist/structures/Tag.js +52 -0
  27. package/dist/structures/Tag.js.map +1 -0
  28. package/dist/structures/TagListParameters.d.ts +14 -0
  29. package/dist/structures/TagListParameters.d.ts.map +1 -0
  30. package/dist/structures/TagListParameters.js +7 -0
  31. package/dist/structures/TagListParameters.js.map +1 -0
  32. package/dist/structures/TagListResults.d.ts +53 -0
  33. package/dist/structures/TagListResults.d.ts.map +1 -0
  34. package/dist/structures/TagListResults.js +73 -0
  35. package/dist/structures/TagListResults.js.map +1 -0
  36. package/package.json +14 -15
  37. 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
- [![CircleCI](https://img.shields.io/circleci/project/github/AtoraSuunva/booru.svg)](https://circleci.com/gh/AtoraSuunva/booru) ![npm](https://img.shields.io/npm/v/booru.svg) ![GitHub](https://img.shields.io/github/license/AtoraSuunva/booru.svg) ![Typescript typings](https://img.shields.io/badge/Typings-Typescript-informational.svg)
5
+ ![npm](https://img.shields.io/npm/v/booru.svg) ![GitHub](https://img.shields.io/github/license/AtoraSuunva/booru.svg) ![Typescript typings](https://img.shields.io/badge/Typings-Typescript-informational.svg)
6
6
 
7
- *Minimum supported Node.js version: >=18.17*
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 = Booru.forSite('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 and code style (Not super strict about it, but it's best if it roughly follows the rest of the code)
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
  ---