peekalink
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Peekalink Node.js API Client

This module is an API client for the Peekalink service to be used in Node.js. This module does NOT work in the browser.

Usage

Installation:

npm i peekalink

... or:

yarn add peekalink

Usage with CommonJS:

const { Client } = require('peekalink');
const client = new Client({ apiKey: 'your-api-key' });

Usage with ES imports:

import { Client } from 'peekalink';
const client = new Client({ apiKey: 'your-api-key' });

Methods

Get link preview data:

const preview = await client.preview('https://okuna.io');

Check if a link is available:

const availability = await client.isAvailable('https://ankida.agency');

Contribution

The Peekalink Node.js API client library is an open-source project and any contribution is welcome! When contributing, we kindly ask you to make sure your changes pass linting:

npm run lint

Unit tests must always pass before submitting a PR. If you've made major changes on the code, we also expect you to update/write unit tests and make sure they pass. The unit tests should never interact with the real API - we have mocks for that.

npm run test

To get test coverage reports, run the following command:

npm run test:cover

License

The module is licensed under the MIT license.

Package Sidebar

Install

npm i peekalink

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

27.4 kB

Total Files

27

Last publish

Collaborators

  • jozsefsallai