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

@appitude/lcms-storage

v0.1.1

Published

Official TypeScript/JavaScript SDK for LCMS Storage - Asset management and CDN platform

Readme

LCMS Storage - TypeScript/Node.js SDK

Official TypeScript/JavaScript SDK for LCMS Storage - Asset management and CDN platform.

Features

  • Upload files to LCMS Storage from file paths or Buffers
  • Delete assets from storage
  • List directory contents
  • Generate asset URLs with automatic CDN delivery
  • Full TypeScript support with type definitions
  • Zero dependencies (uses native fetch API)
  • Works in Node.js 18+ and modern browsers

Requirements

  • Node.js 18.0 or higher
  • npm or yarn

Installation

npm install @appitudeio/lcms-storage

Quick Start

import { Storage } from '@appitudeio/lcms-storage';

// Initialize client
const storage = new Storage('your-domain.com', 'your_api_key');

// Upload a file
const response = await storage.upload('/path/to/local/image.jpg', '/uploads/image.jpg');
console.log('Uploaded to:', response.url.asset);

// List directory contents
const listing = await storage.list('/uploads');
for (const item of listing.items) {
  console.log(`${item.key} - ${item.url}`);
}

// Delete file
await storage.delete('/uploads/old-image.jpg');

API Reference

Constructor

const storage = new Storage(domain: string, apiKey: string);

Initialize the LCMS Storage client with your domain and API key.


upload()

async upload(
  filePathOrBuffer: string | Buffer,
  remotePath: string,
  contentType?: string
): Promise<UploadResponse>

Upload a file to LCMS Storage.

Examples:

// Upload from file path (MIME type auto-detected)
const response = await storage.upload('/tmp/photo.jpg', '/gallery/photo.jpg');

// Upload from Buffer (contentType required)
import { readFileSync } from 'fs';
const buffer = readFileSync('/tmp/photo.jpg');
const response = await storage.upload(buffer, '/gallery/photo.jpg', 'image/jpeg');

// Check response
if (response.success) {
  console.log('Uploaded:', response.url.asset);
}

delete()

async delete(path: string): Promise<void>

Delete a file from LCMS Storage.

Example:

await storage.delete('/gallery/old-photo.jpg');

list()

async list(path: string = ''): Promise<ListResponse>

List contents of a directory.

Example:

const listing = await storage.list('/gallery');

console.log('Directory:', listing.path);
console.log('Total files:', listing.count());

// List files
for (const item of listing.items) {
  console.log(`${item.key} - ${item.size} bytes`);
  console.log(`URL: ${item.url}`);
}

// List subdirectories
for (const prefix of listing.prefixes) {
  console.log(`Subdirectory: ${prefix}`);
}

// Check if empty
if (listing.isEmpty()) {
  console.log('Directory is empty');
}

Response Objects

UploadResponse

Properties:

  • boolean success - Whether upload was successful
  • string message - Success or error message
  • object url - Contains 'asset' and 'upload' URLs

Methods:

  • toObject(): Record<string, any>
  • toJson(): string

ListResponse

Properties:

  • boolean success - Whether the operation was successful
  • string message - Success or error message
  • string path - Directory path that was listed
  • string assetBaseUrl - Base URL for accessing assets
  • ListItem[] items - Array of file items with 'key', 'size', 'lastModified', 'url'
  • string[] prefixes - Array of subdirectory prefixes

Methods:

  • count(): number - Number of items
  • isEmpty(): boolean - Whether directory is empty
  • toObject(): Record<string, any>
  • toJson(): string

Error Handling

try {
  const response = await storage.upload('/path/to/file.jpg', '/uploads/file.jpg');
  if (response.success) {
    console.log('Success:', response.url.asset);
  } else {
    console.log('Upload failed:', response.message);
  }
} catch (error) {
  console.error('Upload error:', error.message);
}

License

MIT License - see LICENSE file for details.


Support

For issues and questions:


Related