1.0.1 • Published 12 months ago

free-content-ai-writer v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Free Content AI Writer

Free Content AI Writer is an npm package that provides easy access to AI-powered text generation using a free AI Writer API.

Installation

npm install free-content-ai-writer

Usage

const FreeContentAIWriter = require('free-content-ai-writer');

const writer = new FreeContentAIWriter();

async function generateText() {
  try {
    const article = await writer.generate('article', 'The Future of AI');
    console.log(article);
  } catch (error) {
    console.error('Error:', error);
  }
}

generateText();

API

new FreeContentAIWriter()

Creates a new instance of the FreeContentAIWriter class.

generate(type, title)

Generates text based on the given type and title.

  • type: The type of writing (e.g., 'article', 'poem', 'essay').
  • title: The title or topic of the writing.

Returns a Promise that resolves with the generated text.

Example

const FreeContentAIWriter = require('free-content-ai-writer');

const writer = new FreeContentAIWriter();

writer.generate('article', 'The Impact of Artificial Intelligence')
  .then(content => console.log(content))
  .catch(error => console.error('Error:', error));

Error Handling

The generate method will throw an error if:

  • Either type or title is missing
  • There's an issue with the API request

Make sure to handle these errors in your code.

License

LICENSE

Author

JohnDev19

1.0.1

12 months ago

1.0.0

12 months ago