+77
| # Writebot Library | ||
| Writebot is a Node.js library that enables developers to generate text using AI. Using Writebot, developers can create their own custom text generation presets to fit their specific needs. | ||
| ## Docs | ||
| You can find the full documentation for [Writebot here](https://writebot.app/docs/intro). | ||
| ## Overview | ||
| Writebot works by taking a preset and a set of parameters and producing text with the corresponding AI. | ||
| However, developers can also create their own custom presets to fit their needs. | ||
| ## Installation | ||
| To install Writebot, use the following command: | ||
| `npm install writebot` | ||
| or | ||
| `yarn add writebot` | ||
| ## Usage | ||
| Writebot is a Node.js library and can be used in any Node.js project. To use Writebot, import the library and the desired preset: | ||
| To generate text with the desired preset first get your API Key from openai, then use the `write` method and pass in the preset name or object and the parameters: | ||
| ### Using the preset object | ||
| This will generate a tweet about AIs with an "afraid" tone. | ||
| ```js | ||
| const {Writebot} = require('writebot'); | ||
| const TweetGen = require('tweet-gen'); | ||
| Writebot.initialize({ | ||
| // You can get this at openai | ||
| apiKey: 'API_KEY', | ||
| }) | ||
| const tweet = Writebot.write(TweetGen, { | ||
| description: 'A tweet about AIs', | ||
| tone: 'Afraid' | ||
| }); | ||
| ``` | ||
| Result: | ||
| ```text | ||
| I'm scared of the way #AI is taking over our world. It feels like our humanity is being taken away from us, one algorithm at a time. #AIisComing | ||
| ``` | ||
| ### Using the preset name | ||
| Or if you would like to use string to identify preset you could do it like this: | ||
| ```js | ||
| const Writebot = require('writebot'); | ||
| Writebot.initialize({ | ||
| apiKey: 'API_KEY', | ||
| // Add the presets you would like to use here. | ||
| types: [ | ||
| require('tweet-gen') | ||
| ] | ||
| }) | ||
| const tweet = Writebot.write('tweet', { | ||
| description: 'A tweet meme about developers.', | ||
| tone: 'Sarcastic' | ||
| }); | ||
| ``` | ||
| Result: | ||
| ```text | ||
| Developers: Always finding new and creative ways to break things. #ProgrammingProblems | ||
| ``` | ||
| ## License | ||
| Writebot is released under the MIT License. See [LICENSE](https://github.com/writebot/writebot/blob/master/LICENSE) for details. |
@@ -11,7 +11,7 @@ $ tsup *.ts --format cjs --dts | ||
| [32mCJS[39m [1mdist/openai.js [22m[32m2.06 KB[39m | ||
| [32mCJS[39m ⚡️ Build success in 186ms | ||
| [32mCJS[39m ⚡️ Build success in 140ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 11620ms | ||
| [32mDTS[39m ⚡️ Build success in 8047ms | ||
| [32mDTS[39m [1mdist/Writebot.d.ts [22m[32m737.00 B[39m | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m105.00 B[39m | ||
| [32mDTS[39m [1mdist/openai.d.ts [22m[32m447.00 B[39m |
+13
-13
| $ TIMING=1 eslint "**/*.ts*" | ||
| (node:1952) [ESLINT_LEGACY_ECMAFEATURES] DeprecationWarning: The 'ecmaFeatures' config file property is deprecated and has no effect. (found in "../../.eslintrc.js » eslint-config-custom") | ||
| (node:2009) [ESLINT_LEGACY_ECMAFEATURES] DeprecationWarning: The 'ecmaFeatures' config file property is deprecated and has no effect. (found in "../../.eslintrc.js » eslint-config-custom") | ||
| (Use `node --trace-deprecation ...` to show where the warning was created) | ||
@@ -12,13 +12,13 @@ | ||
| Rule | Time (ms) | Relative | ||
| :-----------------------------------------|----------:|--------: | ||
| @typescript-eslint/no-unused-vars | 82.601 | 47.4% | ||
| @typescript-eslint/no-explicit-any | 17.200 | 9.9% | ||
| react-hooks/rules-of-hooks | 16.790 | 9.6% | ||
| @typescript-eslint/no-inferrable-types | 16.410 | 9.4% | ||
| react/display-name | 16.065 | 9.2% | ||
| @typescript-eslint/triple-slash-reference | 7.421 | 4.3% | ||
| react/no-direct-mutation-state | 2.934 | 1.7% | ||
| react/require-render-return | 1.805 | 1.0% | ||
| object-curly-spacing | 1.710 | 1.0% | ||
| @typescript-eslint/no-loss-of-precision | 1.229 | 0.7% | ||
| Rule | Time (ms) | Relative | ||
| :---------------------------------------|----------:|--------: | ||
| react/jsx-no-comment-textnodes | 75.316 | 35.5% | ||
| @typescript-eslint/object-curly-spacing | 50.050 | 23.6% | ||
| react/display-name | 33.179 | 15.6% | ||
| @typescript-eslint/no-unused-vars | 32.405 | 15.3% | ||
| react-hooks/exhaustive-deps | 8.496 | 4.0% | ||
| react/no-direct-mutation-state | 1.530 | 0.7% | ||
| react/require-render-return | 1.337 | 0.6% | ||
| object-curly-spacing | 1.138 | 0.5% | ||
| @typescript-eslint/no-explicit-any | 0.818 | 0.4% | ||
| @typescript-eslint/no-empty-function | 0.775 | 0.4% |
+6
-0
| # writerjs | ||
| ## 0.6.1 | ||
| ### Patch Changes | ||
| - ba5b2bc: Added README | ||
| ## 0.6.0 | ||
@@ -4,0 +10,0 @@ |
+1
-1
| { | ||
| "name": "writebot", | ||
| "version": "0.6.0", | ||
| "version": "0.6.1", | ||
| "main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
19349
12.5%15
7.14%1
-50%78
Infinity%