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 🙏

© 2025 – Pkg Stats / Ryan Hefner

1fichier

v1.0.2

Published

A typescript client for the 1fichier API

Readme

1fichier-ts

A fully-typed TypeScript client for the 1fichier.com API. Supports all endpoints from the official OpenAPI spec, including file upload/download, folder management, user info, remote upload, and vouchers.

Features

  • Full coverage of 1fichier.com API endpoints
  • TypeScript types for all request/response schemas
  • Modern async/await API
  • Built-in authentication via API key
  • Axios-based HTTP client
  • Easy to extend and test

Installation

npm install 1fichier

Usage

Basic Example

import FichierApiClient from "1fichier";

const client = new FichierApiClient("YOUR_API_KEY");

// Generate a download token
const token = await client.getDownloadToken({ url: "https://1fichier.com/?example" });
console.log(token.url);

// List files in root folder
const files = await client.listFiles({ folder_id: 0 });
console.log(files.items);

Authentication

All requests require a valid API key. Pass your API key when constructing the client:

const client = new FichierApiClient("YOUR_API_KEY");

API Reference

File Operations

  • getDownloadToken(data) - Generate a download token for a file
  • getFileInfo(data) - Get detailed info about a file
  • listFiles(data) - List files in a folder
  • scanFile(data) - Scan a file for viruses
  • removeFiles(data) - Remove files
  • moveFiles(data) - Move files
  • renameFiles(data) - Rename files
  • copyFiles(data) - Copy files
  • changeFileAttr(data) - Change file attributes

Upload

  • getUploadServer(pretty) - Get optimal upload server
  • uploadFiles(formData) - Upload files (multipart/form-data)
  • getUploadResult(xid) - Get upload result

Folder Operations

  • listFolders(data) - List folders
  • createFolder(data) - Create a folder
  • shareFolder(data) - Share a folder
  • moveFolder(data) - Move a folder
  • removeFolder(data) - Remove a folder

User

  • getUserInfo(data) - Get/set account info

Remote Upload

  • listRemoteUploads() - List remote uploads
  • getRemoteUploadInfo(id) - Get remote upload info
  • requestRemoteUpload(data) - Request remote upload

Vouchers

  • listVouchers() - List unused vouchers
  • checkVoucher(data) - Check voucher validity
  • useVoucher(data) - Use voucher

TypeScript Types

All request and response schemas are fully typed. See src/types.ts for details.

Error Handling

All methods throw on HTTP/network errors. Use try/catch for error handling:

try {
	const info = await client.getFileInfo({ url: "https://1fichier.com/?example" });
} catch (err) {
	console.error("API error", err);
}

Testing

Unit tests are provided using Vitest. Run tests with:

npm test

Contributing

Contributions are welcome! To contribute:

  1. Fork the repo and create your branch.
  2. Write clear, tested code. Add/modify tests in src/index.test.ts.
  3. Ensure all types are correct and documented.
  4. Open a pull request with a detailed description.

Development Setup

git clone https://github.com/nunsie/1fichier-ts.git
cd 1fichier-ts
npm install
npm test

Coding Standards

  • Use TypeScript strict mode
  • Document all public methods
  • Prefer async/await
  • Write unit tests for new features

License

MIT © 2025 Nusrath Khan

Links