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

nafri-sdk

v1.0.2

Published

Nafri SDK is an NPM package that lets you easily integrate cloud storage features into your app, With simple APIs for file uploads, storage, and sharing, it provides a scalable solution for managing cloud data. Perfect for adding cloud storage capabilitie

Readme

Nafri SDK

A JavaScript SDK for interacting with the Nafri platform API. Use it to upload files, delete files, and list uploaded files effortlessly.

Features

  • Upload files to Nafri
  • Delete files by ID
  • List all uploaded files
  • Lightweight and easy to integrate

Installation

Install the SDK via npm:

npm install nafri-sdk

Usage

Import and Initialize

import Nafri from "nafri-sdk";

const nafri = new Nafri({ baseUrl: "https://example-nafri.com/api", apiKey: "your-api-key", });

Methods

uploadFile(file: File): Promise Uploads a file to the Nafri platform.

const file = fileInput.files[0];

nafri.uploadFile(file)
  .then((response) => console.log("File uploaded:", response))
  .catch((error) => console.error("Upload failed:", error));

Deletes a file by its ID.

  .then((response) => console.log("File deleted:", response))
  .catch((error) => console.error("Deletion failed:", error));

Lists all uploaded files.

  .then((files) => console.log("Uploaded files:", files))
  .catch((error) => console.error("Fetching files failed:", error));

Example Workflow

  baseUrl: "https://example-nafri.com/api",
  apiKey: "your-api-key",
});

// Upload a file
const file = document.querySelector('input[type="file"]').files[0];
nafri.uploadFile(file)
  .then((response) => console.log("File uploaded successfully:", response))
  .catch((error) => console.error("File upload failed:", error));

// Delete a file
nafri.deleteFile("fileId123")
  .then((response) => console.log("File deleted successfully:", response))
  .catch((error) => console.error("File deletion failed:", error));

// List all files
nafri.listFiles()
  .then((files) => console.log("Files:", files))
  .catch((error) => console.error("Fetching files failed:", error));

Configuration

During initialization, the Nafri class requires a configuration object: | Property | Type | Description | | ----------- | ----------- | -------------------------------- | | baseUrl | String | The base URL of the Nafri API | | apiKey | String | Your API key for authentication |

Example Configuration

  baseUrl: "https://example-nafri.com/api",
  apiKey: "your-api-key",
});

Error Handling

Errors are thrown as JavaScript Error objects. Handle them using .catch() or try-catch blocks.

  const files = await nafri.listFiles();
  console.log("Files:", files);
} catch (error) {
  console.error("Error fetching files:", error);
}

License

This SDK is licensed under the MIT License. Feel free to use, modify, and contribute.

Contributing

Contributions are welcome! Submit issues or pull requests on the GitHub repository.