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

ts-api-automation

v1.1.2

Published

TypeScript API Automation Framework for testing and interacting with RESTful APIs

Downloads

167

Readme

TypeScript API Automation Framework

A robust and extensible TypeScript framework for API testing and automation. This framework provides features like request queuing, caching, error handling, and more to make API testing easier and more reliable.

Features

  • Request Management
    • Automatic request queuing with configurable concurrency
    • Response caching for GET requests
    • Configurable retry mechanism
  • Error Handling
    • Custom error types (NetworkError, ValidationError)
    • Detailed error information including status codes and response data
  • Request Customization
    • Support for custom headers and authentication
    • Request interceptors for modifying requests
  • Performance
    • Efficient request queuing to prevent API overload
    • Configurable caching to reduce unnecessary requests

Project Structure

ts-api-automation/
├── src/
│   ├── config/
│   │   └── apiConfig.ts       # API configuration (base URL, endpoints)
│   ├── services/
│   │   └── apiService.ts      # Main API service implementation
│   ├── utils/
│   │   ├── errors.ts          # Custom error classes
│   │   └── logger.ts          # Logging utility
│   ├── tests/
│   │   └── api.test.ts        # API tests
│   └── index.ts               # Main entry point
├── docs/
│   ├── README.md              # This documentation
│   └── USAGE.md              # Detailed usage guide
├── package.json
├── tsconfig.json
└── .gitignore

Quick Start

  1. Install the package:
npm install ts-api-automation
  1. Import and use:
import { ApiService } from 'ts-api-automation';

const api = new ApiService({
  baseUrl: 'https://api.example.com'
});

// Make API requests
const users = await api.get('/users');
const newUser = await api.post('/users', { 
  name: 'John Doe',
  email: '[email protected]'
});

Documentation

For detailed information about using this framework in your projects, please refer to our Usage Guide. The guide covers:

  • Complete setup and configuration
  • Making type-safe API requests
  • Error handling strategies
  • Authentication and interceptors
  • Caching and request queuing
  • Best practices and examples
  • Service layer implementation

Development

  1. Clone the repository:
git clone https://github.com/Sharma-IT/ts-api-automation.git
cd ts-api-automation
  1. Install dependencies:
npm install
  1. Run tests:
npm test
  1. Build the package:
npm run build

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the GNU v3.0 License - see the LICENSE file for details.