apna-link-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Apna.Link JavaScript/TypeScript API Wrapper

This is a JavaScript and TypeScript wrapper for the Apna.Link URL shortening API.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js and npm installed on your local development machine.

Installing

To install the package, run:

npm install apna-link-js

Usage

First, import the package:

const ApnaLinkAPI = require('apna-link-js').default;

Then, create an instance of the ApnaLinkAPI class:

const api = new ApnaLinkAPI('your-api-key'); // Get it from https://apna.link/account

You can now use the api instance to interact with the Apna.Link API:

api.shorten('https://example.com')
    .then(shortUrl => console.log(`Short URL: ${shortUrl}`))
    .catch(error => console.error(`Error: ${error}`));

Running the tests

To run the tests, use the following command:

npm test

Based on

This library is based on the Apna.link API Docs.

Contributing

Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details

Package Sidebar

Install

npm i apna-link-js

Weekly Downloads

12

Version

1.0.6

License

MIT

Unpacked Size

5.63 kB

Total Files

5

Last publish

Collaborators

  • cstayyab