npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sharpapi/sharpapi-node-paraphrase

v1.0.1

Published

SharpAPI.com Node.js SDK for paraphrasing text

Readme

SharpAPI GitHub cover

SharpAPI NodeJS Paraphrase SDK

🚀 Automate text paraphrasing with AI-powered API

Leverage AI API to generate paraphrased versions of your text content for content creation, SEO, and more.

SharpAPI.com Node.js Paraphrase SDK enables developers to integrate advanced text paraphrasing capabilities into their Node.js applications. This SDK simplifies interaction with the SharpAPI paraphrasing service, providing a seamless way to generate alternative versions of your text content.

See more at SharpAPI.com Website »

Version License

Requirements

  • Node.js >= 16.x

Installation

npm i @sharpapi/sharpapi-node-paraphrase

Table of Contents

  1. Installation
  2. Configuration
  3. Usage
  4. Examples
  5. Contributing
  6. License

Installation

Prerequisites

  • Node.js v16 or higher
  • npm (Node Package Manager)

Install via npm

You can install the SharpAPI Node.js Paraphrase SDK using npm:

npm install @sharpapi/sharpapi-node-paraphrase

Install via Yarn

Alternatively, if you prefer using Yarn:

yarn add @sharpapi/sharpapi-node-paraphrase

Configuration

Setting Up Environment Variables

To protect your credentials, it's recommended to use a .env file to store your SharpAPI API key. Follow these steps:

  1. Create a .env File

    In the root directory of your project, create a file named .env:

    SHARP_API_KEY=your_actual_api_key_here
  2. Install dotenv Package

    To load environment variables from the .env file, install the dotenv package:

    npm install dotenv
  3. Load Environment Variables

    At the beginning of your application (e.g., in app.js or index.js), add the following line to load the environment variables:

    require('dotenv').config();
  4. Ensure .env is Ignored

    Add .env to your .gitignore file to prevent sensitive information from being committed to version control:

    # .gitignore
    .env

Usage

Initialization

First, import and initialize the SharpApiParaphraseService with your API key:

// Load environment variables
require('dotenv').config();

// Import the SharpApiParaphraseService
const { SharpApiParaphraseService } = require('@sharpapi/sharpapi-node-paraphrase');

// Initialize the SharpApiParaphraseService
const apiKey = process.env.SHARP_API_KEY;
const paraphraseService = new SharpApiParaphraseService(apiKey);

Available Methods

The SharpApiParaphraseService class provides a method to paraphrase text:

paraphrase(text, language, maxLength, voiceTone, context)

  • Description: Generates a paraphrased version of the provided text.
  • Parameters:
    • text (string): The text to paraphrase.
    • language (string, optional): Language of the paraphrase (default: 'English').
    • maxLength (number, optional): Maximum length of the paraphrased text.
    • voiceTone (string, optional): Tone of the voice in the paraphrase (e.g., 'Neutral').
    • context (string, optional): Additional context for paraphrasing.
  • Returns: A Promise that resolves to a status URL.
  • Usage:
    const statusUrl = await paraphraseService.paraphrase(
      "Original text to paraphrase.",
      "English",
      100,
      "Neutral",
      null
    );
      
    // Fetch the results using the core service
    const { SharpApiCoreService } = require('@sharpapi/sharpapi-node-core');
    const coreService = new SharpApiCoreService(apiKey);
    const resultJob = await coreService.fetchResults(statusUrl);
    console.log(resultJob.getResultJson());

Examples

Basic Paraphrasing

require('dotenv').config();
const { SharpApiParaphraseService } = require('@sharpapi/sharpapi-node-paraphrase');
const { SharpApiCoreService } = require('@sharpapi/sharpapi-node-core');

async function paraphraseExample() {
  const apiKey = process.env.SHARP_API_KEY;
  const paraphraseService = new SharpApiParaphraseService(apiKey);
  const coreService = new SharpApiCoreService(apiKey);

  try {
    // Original text to paraphrase
    const originalText = "The quick brown fox jumps over the lazy dog.";
    
    // Paraphrase the text
    const statusUrl = await paraphraseService.paraphrase(originalText);
    
    // Fetch the results
    const resultJob = await coreService.fetchResults(statusUrl);
    const result = resultJob.getResultJson();
    
    console.log("Original Text:", originalText);
    console.log("Paraphrased Text:", result.paraphrased_text);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

paraphraseExample();

Advanced Paraphrasing with Options

require('dotenv').config();
const { SharpApiParaphraseService } = require('@sharpapi/sharpapi-node-paraphrase');
const { SharpApiCoreService } = require('@sharpapi/sharpapi-node-core');

async function advancedParaphraseExample() {
  const apiKey = process.env.SHARP_API_KEY;
  const paraphraseService = new SharpApiParaphraseService(apiKey);
  const coreService = new SharpApiCoreService(apiKey);

  try {
    // Original text to paraphrase
    const originalText = "The company has experienced significant growth in the last quarter, with revenue increasing by 25%.";
    
    // Paraphrase the text with specific options
    const statusUrl = await paraphraseService.paraphrase(
      originalText,
      "English",
      150,
      "Professional",
      "Financial report"
    );
    
    // Fetch the results
    const resultJob = await coreService.fetchResults(statusUrl);
    const result = resultJob.getResultJson();
    
    console.log("Original Text:", originalText);
    console.log("Paraphrased Text:", result.paraphrased_text);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

advancedParaphraseExample();

API Documentation

For detailed usage and API methods, please refer to the SharpAPI.com Documentation.


Changelog

Please see CHANGELOG for more information on what has changed recently.


Contributing

Check CONTRIBUTION.md file for details.


License

This project is licensed under the MIT License.


Support

If you encounter any issues or have questions, feel free to open an issue on the GitHub repository or contact support at [email protected].


Social Media

🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:


Happy Coding with SharpAPI Node.js Paraphrase SDK!