fortune-teller 0.1.0 → 0.3.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 (67) hide show
  1. package/LICENSE +53 -0
  2. package/README.md +37 -0
  3. package/data/fortunes.json +1 -0
  4. package/lib/build-data.js +52 -0
  5. package/lib/fortune.js +16 -10
  6. package/lib/fortune.mjs +7 -0
  7. package/package.json +20 -5
  8. package/third-party/fortune-mod-1.99.1/Notes +178 -0
  9. package/third-party/fortune-mod-1.99.1/README.md +19 -0
  10. package/third-party/fortune-mod-1.99.1/fortune.c.license +37 -0
  11. package/.npmignore +0 -27
  12. package/fortunes/art +0 -2242
  13. package/fortunes/ascii-art +0 -153
  14. package/fortunes/computers +0 -5417
  15. package/fortunes/cookie +0 -5716
  16. package/fortunes/definitions +0 -5030
  17. package/fortunes/drugs +0 -1155
  18. package/fortunes/education +0 -952
  19. package/fortunes/ethnic +0 -854
  20. package/fortunes/food +0 -886
  21. package/fortunes/fortunes +0 -920
  22. package/fortunes/goedel +0 -204
  23. package/fortunes/humorists +0 -1016
  24. package/fortunes/kids +0 -710
  25. package/fortunes/law +0 -1260
  26. package/fortunes/linuxcookie +0 -499
  27. package/fortunes/literature +0 -1257
  28. package/fortunes/love +0 -576
  29. package/fortunes/magic +0 -194
  30. package/fortunes/medicine +0 -423
  31. package/fortunes/men-women +0 -2556
  32. package/fortunes/miscellaneous +0 -1738
  33. package/fortunes/news +0 -260
  34. package/fortunes/off/Makefile +0 -32
  35. package/fortunes/off/unrotated/astrology +0 -289
  36. package/fortunes/off/unrotated/black-humor +0 -1947
  37. package/fortunes/off/unrotated/definitions +0 -1397
  38. package/fortunes/off/unrotated/drugs +0 -360
  39. package/fortunes/off/unrotated/ethnic +0 -1082
  40. package/fortunes/off/unrotated/hphobia +0 -405
  41. package/fortunes/off/unrotated/limerick +0 -6376
  42. package/fortunes/off/unrotated/misandry +0 -83
  43. package/fortunes/off/unrotated/miscellaneous +0 -330
  44. package/fortunes/off/unrotated/misogyny +0 -297
  45. package/fortunes/off/unrotated/politics +0 -2018
  46. package/fortunes/off/unrotated/privates +0 -1015
  47. package/fortunes/off/unrotated/racism +0 -12
  48. package/fortunes/off/unrotated/religion +0 -1364
  49. package/fortunes/off/unrotated/riddles +0 -1089
  50. package/fortunes/off/unrotated/sex +0 -4578
  51. package/fortunes/off/unrotated/songs-poems +0 -2271
  52. package/fortunes/off/unrotated/vulgarity +0 -1089
  53. package/fortunes/people +0 -4265
  54. package/fortunes/pets +0 -186
  55. package/fortunes/platitudes +0 -1366
  56. package/fortunes/politics +0 -2918
  57. package/fortunes/riddles +0 -595
  58. package/fortunes/science +0 -3010
  59. package/fortunes/songs-poems +0 -7151
  60. package/fortunes/sports +0 -814
  61. package/fortunes/startrek +0 -820
  62. package/fortunes/translate-me +0 -64
  63. package/fortunes/wisdom +0 -1576
  64. package/fortunes/work +0 -2724
  65. package/fortunes/zippy +0 -1289
  66. package/lib/convert.js +0 -61
  67. package/lib/loader.js +0 -35
package/LICENSE ADDED
@@ -0,0 +1,53 @@
1
+ BSD 3-Clause License
2
+ ====================
3
+
4
+ This project's code -- lib/fortune.js, lib/fortune.mjs, lib/build-data.js,
5
+ package.json and README.md:
6
+
7
+ Copyright (c) 2014-2026 William Fligor
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ 1. Redistributions of source code must retain the above copyright notice, this
13
+ list of conditions and the following disclaimer.
14
+
15
+ 2. Redistributions in binary form must reproduce the above copyright notice,
16
+ this list of conditions and the following disclaimer in the documentation
17
+ and/or other materials provided with the distribution.
18
+
19
+ 3. Neither the name of the copyright holder nor the names of its
20
+ contributors may be used to endorse or promote products derived from
21
+ this software without specific prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ Fortune data
35
+ ============
36
+
37
+ fortunes/ in this repository, and data/fortunes.json in the published package,
38
+ are a subset of the fortune database distributed with fortune-mod 1.99.1. The BSD
39
+ 3-Clause terms above apply to this project's code only; they are not asserted
40
+ over the fortune data, and the individual quotations are not owned by this
41
+ project.
42
+
43
+ The only statement upstream makes about the database is in its Notes file,
44
+ carried over from NetBSD. Both that file and the 4-clause license notice from
45
+ upstream's `fortune/fortune.c` are shipped verbatim in
46
+ third-party/fortune-mod-1.99.1/:
47
+
48
+ The fortunes contained in the fortune database have been collected
49
+ haphazardly from a cacophony of sources, in number so huge it boggles the
50
+ mind. It is impossible to do any meaningful quality control on
51
+ attributions, or lack thereof, or exactness of the quote. Since this
52
+ database is not used for profit, and since entire works are not published,
53
+ it falls under fair use, as we understand it.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ fortune
2
+ =======
3
+
4
+ ## To install
5
+ ```js
6
+ npm install fortune-teller
7
+ ```
8
+
9
+ ## To use
10
+ ```js
11
+ const fortune = require('fortune-teller')
12
+
13
+ fortune()
14
+ ```
15
+
16
+ `fortune.fortune()` still works, so 0.1.x call sites keep running. With ESM,
17
+ both `import fortune from 'fortune-teller'` and
18
+ `import { fortune } from 'fortune-teller'` work.
19
+
20
+ On install nothing is built. The fortunes are committed as data/fortunes.json
21
+ and shipped in the package. In a git checkout you can add or remove files under
22
+ fortunes/ and rebuild with `npm run build`; the published package ships only the
23
+ generated data, not the raw fortune files, so there `npm run build` reports that
24
+ there is nothing to rebuild.
25
+
26
+ ## License
27
+
28
+ This project's code is BSD 3-Clause; see [LICENSE](./LICENSE).
29
+
30
+ The fortunes are a subset of the fortune database shipped with
31
+ [fortune-mod 1.99.1](https://github.com/shlomif/fortune-mod), not a verbatim copy
32
+ of it. That release carries no license covering the data, and the individual
33
+ quotations are not owned by this project: many are public domain or de minimis,
34
+ others are short excerpts from in-copyright works, attributed to their authors
35
+ where the source provided an attribution. Upstream's license notice and Notes
36
+ file ship verbatim in
37
+ [third-party/fortune-mod-1.99.1/](./third-party/fortune-mod-1.99.1/).