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 🙏

© 2026 – Pkg Stats / Ryan Hefner

flyone

v1.0.6

Published

Flyone is a TypeScript-based library for interacting with the Flyone API, providing seamless integration and functionality for link management.

Readme

Flyone Library

Flyone is a TypeScript-based library for interacting with the Flyone API, providing seamless integration and functionality for link management.

Features

  • Create links
  • Update existing links
  • Delete links
  • Fetch all links or specific links by ID
  • Track clicks over time
  • Manage device-specific and country-specific targeting

Installation

Install the library via npm or yarn:

npm install flyone

or

yarn add flyone

Usage

Importing the Library

import { Flyone } from "flyone";

Initializing the Flyone Instance

const flyone = new Flyone({
  apiKey: "SavanaPoint Your-API-Key-Here",
  orgId: "Your-Organization-Id-Here",
});

Examples

Create a Short Link

const newLink = await flyone.createShortLink({
  originalUrl: "https://example.com",
  title: "My Example Link",
});
console.log("Created Link:", newLink);

Fetch All Links

const links = await flyone.getAllLinks();
console.log("All Links:", links);

Get a Link by ID

const link = await flyone.getLinkById("link-id-here");
console.log("Link Details:", link);

Update a Short Link

const updatedLink = await flyone.updateShortLink("link-id-here", {
  title: "Updated Title",
});
console.log("Updated Link:", updatedLink);

Delete a Short Link

await flyone.deleteShortLink("link-id-here");
console.log("Link deleted successfully.");

Track Clicks Over Time

const clicks = await flyone.getClicksOverTime("link-id-here");
console.log("Clicks Over Time:", clicks);

Remove a Device Target

await flyone.removeDevice("link-id-here", "device-id-here");
console.log("Device removed successfully.");

Remove a Country Target

await flyone.removeCountry("link-id-here", "country-id-here");
console.log("Country removed successfully.");

Error Handling

Errors are handled using a centralized mechanism. In case of an error, the library will throw an exception with a descriptive message. Below are the possible error messages and their corresponding HTTP status codes:

| Status Code | Message | Description | |-------------|---------------------------------------|--------------------------------------------------| | 400 | Invalid request parameters | The request payload is invalid. | | 401 | Unauthorized | The API key or organization ID is missing/invalid.| | 403 | Forbidden | You do not have permission to perform this action.| | 404 | Resource not found | The requested resource does not exist. | | 500 | Internal server error | An unexpected error occurred on the server. | | 503 | Service unavailable | The service is temporarily unavailable. |

Example Error Handling

try {
  await flyone.createShortLink({
    originalUrl: "https://example.com",
    title: "My Example Link",
  });
} catch (error) {
  console.error("Error creating link:", error.message);
}

Configuration Options

FlyoneConfig

| Property | Type | Description | | -------- | ------ | -------------------------------- | | apiKey | string | Your API key for authentication. | | orgId | string | The ID of your organization. |

Development

Running Tests

Tests are written using Jest. To run the tests, use:

npm test

or

yarn test

Building the Library

To build the library for production:

npm run build

or

yarn build

Contributing

Contributions are welcome! Please follow the guidelines below:

  1. Fork the repository.
  2. Create a new branch for your feature/fix.
  3. Commit your changes with clear commit messages.
  4. Submit a pull request.

License

This library is licensed under the MIT License. See the LICENSE file for details.