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 🙏

© 2024 – Pkg Stats / Ryan Hefner

random_word_api

v1.4.5

Published

The Random Word API is a simple Node.js module that provides a random word generator. It can be used to generate random words for various purposes, such as generating passwords, creating dummy data, or adding variety to your projects. This readme file exp

Downloads

20

Readme

Random Word API

The Random Word API is a Node.js application that provides functionality to add words, retrieve random words, and generate random passwords. It can be used in multiple ways: as a standalone application that runs on a server, or by making HTTP requests to the provided endpoints.

Table of Contents

Installation

To use the Random Word API, follow these steps:

  1. Make sure you have Node.js installed on your machine.
  2. Clone the repository or download the source code.
  3. Open a terminal or command prompt and navigate to the project's root directory.
  4. Install the required dependencies by running the following command:
npm i

Usage

Adding Words

To add words to the Random Word API, you can make a GET request to the /addWord/:word endpoint, where :word is the word you want to add.

Example:

GET /addWord/apple

This will add the word "apple" to the list of available words.

Retrieving Words

To retrieve words from the Random Word API, you can make a GET request to the /getWord/:param endpoint, where :param is the parameter value that determines the type of word retrieval.

  • To retrieve a single random word, set :param to 1.

Example:

GET /getWord/1

This will retrieve a single random word from the available words.

  • To retrieve multiple random words, set :param to 2 and provide the number of words you want to retrieve as a query parameter named count.

Example:

GET /getWord/2?count=5

This will retrieve 5 random words from the available words.

Generating Passwords

To generate passwords using the Random Word API, you can make a GET request to the /generatePassword/:length endpoint, where :length is the desired length of the password.

Example:

GET /generatePassword/10

This will generate a random password with a length of 10 characters, consisting of a combination of random words, characters, and numbers.

API Endpoints

The Random Word API provides the following endpoints:

  • GET /addWord/:word: Adds a word to the list of available words.
  • GET /getWord/:param: Retrieves a random word or multiple random words based on the parameter value.
  • GET /getWord/all: Retrieves all random words.
  • GET /generatePassword/:length: Generates a random password of the specified length.
  • GET /generateColor: Generates a random color.

Running the Application

To run the Random Word API application, follow these steps:

  1. Make sure you have completed the installation steps mentioned earlier.
  2. Open a terminal or command prompt and navigate to the project's root directory.
  3. Start the server by running the following command:
npm start
  1. The application will start running on http://localhost:3000. You can now make HTTP requests to the provided endpoints.

Contributing

Contributions to the Random Word API are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. You can find the license information in the LICENSE

file.

Feel free to customize this documentation template according to your project's specific details and requirements. Include additional information such as examples, error handling, or any other relevant details that may help users understand and utilize your Random Word API.