SharpAPI Node.js SDK Client Test Suite / Usage Examples is an educational repository designed to help developers understand and integrate the SharpAPI.com API endpoints into their Node.js applications. This project showcases various use cases and provides practical examples to demonstrate the capabilities of the SharpAPI Node.js SDK Client.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Available Tests
- Project Structure
- Contributing
- License
- Support
- Comprehensive API Testing: Demonstrates how to interact with various SharpAPI endpoints.
- Interactive CLI: Provides a command-line interface to select and run different API tests.
- Educational Examples: Serves as a learning tool for developers to understand the integration process.
- Extensible Structure: Easily add new tests and functionalities as SharpAPI expands.
Before you begin, ensure you have met the following requirements:
- Node.js: Version 14 or higher is installed. Download Node.js
- npm: Comes bundled with Node.js. Verify by running
npm -v
in your terminal. - SharpAPI Account: Obtain an API key from SharpAPI.com.
-
Clone the Repository
git clone https://github.com/sharpapi/sharpapi-node-examples.git
-
Navigate to the Project Directory
cd sharpapi-node-examples
-
Install Dependencies
npm install
This will install all necessary packages, including the SharpAPI Node.js client, dotenv for environment variable management, and inquirer for the interactive CLI.
-
Set Up Environment Variables
Create a
.env
file in the root directory of the project to store your SharpAPI API key securely.cp .env.example .env
Add the following line to the
.env
file:SHARP_API_KEY=your_actual_api_key_here
Note: Replace
your_actual_api_key_here
with your actual SharpAPI API key. You can copy it from SharpAPI.com Dashboard.
The application provides an interactive command-line interface to run various tests against the SharpAPI endpoints. Follow these steps to use the application:
-
Run the Application
npm start
-
Select a Test
Upon running, you'll be presented with a list of available tests. Use the arrow keys to navigate and press
Enter
to select a test. -
Follow Prompts
Some tests may require additional input or file paths. Provide the necessary information as prompted.
-
View Results
After the test completes, the results will be displayed in the console. You can choose to run another test or exit the application.
The application includes a variety of tests to demonstrate the functionality of the SharpAPI Node.js SDK Client:
-
Ping Test
- Description: Checks the availability of the API and retrieves the current timestamp.
-
Quota Test
- Description: Retrieves details about your subscription's current quota and usage.
-
Parse Resume Test
- Description: Parses a resume file (PDF/DOC/DOCX/TXT/RTF) and extracts data points. Replace
sample_resume.pdf
if you want.
- Description: Parses a resume file (PDF/DOC/DOCX/TXT/RTF) and extracts data points. Replace
-
Generate Job Description Test
- Description: Generates a job description based on provided parameters.
-
Related Skills Test
- Description: Retrieves a list of skills related to the provided skill name.
-
Related Job Positions Test
- Description: Retrieves a list of job positions related to the provided job position name.
-
Product Review Sentiment Test
- Description: Analyzes the sentiment of a product review.
-
Product Categories Test
- Description: Generates suitable categories for a given product.
-
Generate Product Intro Test
- Description: Generates a marketing introduction for a product.
-
Generate Thank You Email Test
- Description: Generates a personalized thank-you email for customers.
-
Detect Phones Test
- Description: Detects phone numbers within the provided text.
-
Detect Emails Test
- Description: Detects email addresses within the provided text.
-
Detect Spam Test
- Description: Analyzes the provided text to determine if it contains spam content.
-
Summarize Text Test
- Description: Generates a summarized version of the provided text.
-
Generate Keywords Test
- Description: Generates a list of keywords based on the provided content.
-
Translate Text Test
- Description: Translates the provided text into the specified language.
-
Paraphrase Text Test
- Description: Generates a paraphrased version of the provided text.
-
Proofread Text Test
- Description: Proofreads the provided text, checking for grammar and spelling errors.
-
Generate SEO Tags Test
- Description: Generates META tags based on the provided content.
-
Travel Review Sentiment Test
- Description: Analyzes the sentiment of a travel or hospitality product review.
-
Tours and Activities Product Categories Test
- Description: Generates suitable categories for Tours & Activities products.
-
Hospitality Product Categories Test
- Description: Generates suitable categories for Hospitality products.
-
Run All Tests
- Description: Executes all available tests sequentially.
-
Exit
- Description: Exits the application.
sharpapi-node-examples/
├── .env
├── .gitignore
├── index.js
├── package.json
├── package-lock.json
├── sample_resume.pdf
└── README.md
- .env: Stores environment variables, including the SharpAPI API key.
- .gitignore: Specifies files and directories to ignore in Git.
- index.js: Main application file containing the test functions and CLI logic.
- package.json: Contains project metadata and dependencies.
- package-lock.json: Automatically generated file that describes the exact tree of dependencies.
- sample_resume.pdf: Sample resume file used in the Parse Resume Test.
- README.md: Documentation file (this file).
We welcome contributions to the SharpAPI Node.js Examples repository! To contribute, please follow these steps:
-
Fork the Repository
Click the "Fork" button at the top-right corner of the repository page to create your own fork.
-
Clone the Forked Repository
git clone https://github.com/yourusername/sharpapi-node-examples.git
-
Navigate to the Project Directory
cd sharpapi-node-examples
-
Create a New Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
Implement your feature or bug fix.
-
Commit Your Changes
git add . git commit -m "Add feature: Your Feature Name"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Create a Pull Request
Go to the original repository on GitHub and create a pull request from your forked repository.
- Follow Coding Standards: Ensure your code adheres to the existing coding style.
- Write Tests: Add tests for your new features or bug fixes.
- Update Documentation: If your changes affect usage, update the
README.md
accordingly. - Provide Clear Descriptions: Make sure your commit messages and pull request descriptions are clear and concise.
If you encounter any issues or have questions, feel free to open an issue on the GitHub repository or contact support at [email protected].
🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:
Happy Coding with SharpAPI Node.js Examples!