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

@lilaquadrat/storage-sdk

v0.1.4

Published

SDK for accessing STUDIO storage/media API

Downloads

291

Readme

@lilaquadrat/storage-sdk

SDK for accessing STUDIO storage/media API with support for file uploads, downloads, and listing.

Installation

npm install @lilaquadrat/storage-sdk

or

yarn add @lilaquadrat/storage-sdk

Usage

import StorageSDK from '@lilaquadrat/storage-sdk';

// Initialize the SDK
const storage = new StorageSDK(
  {
    api: 'https://media.lilaquadrat.studio',
    public: 'https://cdn.lilaquadrat.studio',
    secure: 'https://secure.lilaquadrat.studio',
  },
  5, // concurrency
  'info', // log level: 'debug' | 'info' | 'none'
  'your-access-token' // optional access token
);

// Upload a single file
await storage.upload(
  {
    filename: 'example.jpg',
    size: 1024,
    mimetype: 'image/jpeg',
    fullPath: '/path/to/example.jpg'
  },
  {
    app: 'media',
    company: 'your-company',
    project: 'your-project',
    thumbnails: true,
    overwrite: false
  }
);

// Upload multiple files
await storage.uploadMultiple(
  [
    { filename: 'file1.jpg', size: 1024, mimetype: 'image/jpeg', fullPath: '/path/to/file1.jpg' },
    { filename: 'file2.png', size: 2048, mimetype: 'image/png', fullPath: '/path/to/file2.png' }
  ],
  {
    app: 'media',
    company: 'your-company',
    project: 'your-project'
  }
);

// List files
const result = await storage.list(
  {
    app: 'media',
    company: 'your-company',
    project: 'your-project'
  },
  {
    tags: ['image'],
    prefix: 'uploads/',
    ignorePrefix: false
  }
);

// Download a file
const buffer = await storage.download({
  app: 'media',
  company: 'your-company',
  project: 'your-project',
  prefix: 'uploads',
  filename: 'example.jpg'
});

// Get access token
const token = await storage.getAccessToken('html', 'your-company', 'your-project');

API

Constructor

new StorageSDK(endpoints: Endpoints, concurrency?: number, logLevel?: LogLevel, accessToken?: string)
  • endpoints: Object containing API endpoints (api, public, secure)
  • concurrency: Number of concurrent uploads (default: 5)
  • logLevel: Logging level - 'debug', 'info', or 'none' (default: 'info')
  • accessToken: Optional access token for authentication

Methods

upload(file: UploadFile, options: UploadOptions)

Upload a single file to the storage.

uploadMultiple(files: UploadFile[], options: UploadOptions)

Upload multiple files with concurrency control.

list(options: Options, params?: ListFilesParams)

List files in the storage with optional filtering.

download(blob: Storage): Promise<Buffer>

Download a file from the storage.

getAccessToken(app: string, company: string, project: string): Promise<string>

Get an access token for downloading files from secured endpoints. Tokens are cached automatically.

Types

UploadFile

type UploadFile = {
  filename: string;
  size: number;
  mimetype: string;
  fullPath: string;
};

ListFilesParams

type ListFilesParams = {
  tags?: string[];
  prefix?: string;
  ignorePrefix?: boolean;
};

Endpoints

type Endpoints = {
  api: string;
  public: string;
  secure: string;
};

Development

Building

yarn build

Publishing to npm

  1. Make sure you're logged in to npm:

    npm login
  2. Update the version and generate changelog:

    yarn release
  3. Publish to npm:

    npm publish
  4. Push the changes and tags:

    git push --follow-tags origin main

License

MIT