Node.js
For Node.js or modern JavaScript frameworks (e.g., React, Vue, Vite, Webpack), install via your preferred package manager:
Using npm
npm install @bishal-shrestha/rest-client
Using Yarn
yarn add @bishal-shrestha/rest-client
Using pnpm
pnpm add @bishal-shrestha/rest-client
Once installed, import and use the client:
import RestClient from '@bishal-shrestha/rest-client';
const client = new RestClient('https://api.example.com', {
Authorization: 'Bearer YOUR_TOKEN'
});
This method is ideal for projects using modern JavaScript toolchains, including Node.js, React, Vue, Vite, Webpack, or Rollup. This package includes full TypeScript support with no additional configuration required.