Skip to content

rajeev35/smart-api-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart API Toolkit 🚀

Ready-made tools for backend developers. Start simple, scale to production.

Installation

npm install @rajeev3/smart-api-kit

Note: Replace allen with your npm username and SMART-API-KIT with published package name if different.

Quick Start

const api = require('smart-api-kit');

// Response handlers
api.success({ user: 'John' }, 'User created');
api.error('Validation failed', 400);

// Logger
api.logger.info('Server started on port 3000');

// Validators
api.validateEmail('test@example.com'); // true
api.validatePhone('+1234567890'); // true

Features

1. Response Handler

Standardized API responses.

api.success(data, message = 'Success', code = 200);
api.error(message, code = 500);
// Returns: { success: true/false, data/message, code }

2. Logger

Simple leveled logging.

const log = api.logger;
log.info('Info message');
log.error('Error message');
log.warn('Warning message');

3. Validators

Basic input validation.

api.validateEmail(email);
api.validatePhone(phone);

More Coming Soon

  • Express middleware
  • JWT Auth
  • Rate limiting
  • Request tracking

⭐ Star on GitHub!

About

It's a smart-api-kit which help developers alot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors