New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

writebot

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

writebot - npm Package Compare versions

Comparing version
0.6.0
to
0.6.1
+77
README.md
# 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.
+2
-2

@@ -11,7 +11,7 @@ $ tsup *.ts --format cjs --dts

CJS dist/openai.js 2.06 KB
CJS ⚡️ Build success in 186ms
CJS ⚡️ Build success in 140ms
DTS Build start
DTS ⚡️ Build success in 11620ms
DTS ⚡️ Build success in 8047ms
DTS dist/Writebot.d.ts 737.00 B
DTS dist/index.d.ts 105.00 B
DTS dist/openai.d.ts 447.00 B
$ 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%
# writerjs
## 0.6.1
### Patch Changes
- ba5b2bc: Added README
## 0.6.0

@@ -4,0 +10,0 @@

{
"name": "writebot",
"version": "0.6.0",
"version": "0.6.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",