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

tsonik

v1.10.0

Published

A TypeScript client library for the Iconik API based on Swagger documentation

Readme

Tsonik

npm version License: MIT Build Status Lint Status

A TypeScript client library for the Iconik API that makes it easy to manage media assets, collections, jobs, and metadata. Named after the original Python nsa-pythonik library, this is the TypeScript version.

Features

  • 🎯 TypeScript-first with full type safety
  • 🚀 Promise-based API with async/await support
  • 🛡️ Comprehensive error handling with detailed error types
  • 📡 Built on Axios for reliable HTTP requests
  • 🏗️ Resource-based architecture (assets, collections, jobs, metadata)
  • 📚 Extensive documentation with real-world examples
  • Modern ES6+ JavaScript practices

Installation

npm install tsonik
# or
yarn add tsonik

Quick Start

import { Tsonik } from 'tsonik';

// Initialize the client
const client = new Tsonik({
  appId: 'your-app-id',
  authToken: 'your-auth-token'
});

// Get all assets
const assets = await client.assets.listAssets();
console.log(`Found ${assets.data.objects.length} assets`);

// Create a new asset
const newAsset = await client.assets.createAsset({
  title: 'My Video',
  type: 'ASSET',
  description: 'A sample video file'
});

// Get a specific asset
const asset = await client.assets.getAsset('asset-id');
console.log(`Asset: ${asset.data.title}`);

// Work with collections
const collection = await client.collections.createCollection({
  title: 'Marketing Assets',
  description: 'All marketing materials'
});

// Update metadata
await client.metadata.putMetadata(
  'assets',
  newAsset.data.id,
  {
    metadata_values: {
      'custom.project': {
        field_values: [{ value: 'Marketing Campaign' }],
        mode: 'overwrite'
      }
    }
  }
);

// Search for assets
const searchResults = await client.search.search({
  query: 'marketing video',
  size: 10,
  filter: {
    terms: {
      object_type: ['assets']
    }
  }
});
console.log(`Found ${searchResults.data.hits?.total?.value || 0} matching assets`);

Documentation

📖 Getting Started - Complete setup and first steps

💡 Usage Examples - Real-world examples for all features

📚 API Reference - Complete method documentation

🛠️ Best Practices - Performance tips and patterns

🌐 Full Documentation Site - Complete hosted documentation

Authentication

You'll need your Iconik App ID and Auth Token:

// From environment variables (recommended)
const client = new Tsonik({
  appId: process.env.ICONIK_APP_ID!,
  authToken: process.env.ICONIK_AUTH_TOKEN!
});

// Or directly (not recommended for production)
const client = new Tsonik({
  appId: 'your-app-id',
  authToken: 'your-auth-token',
  baseURL: 'https://app.iconik.io' // optional
});

Error Handling

import { IconikAPIError, IconikAuthError } from 'tsonik';

try {
  const asset = await client.assets.get('asset-id');
} catch (error) {
  if (error instanceof IconikAPIError) {
    console.log(`API Error ${error.status}: ${error.message}`);
  } else if (error instanceof IconikAuthError) {
    console.log('Authentication failed');
  }
}

Available Resources

  • client.assets - Asset management (create, read, update, delete)
  • client.collections - Collection management and asset organization
  • client.jobs - Job monitoring and management (transcoding, analysis, etc.)
  • client.files - File operations and metadata
  • client.filesets - Fileset management
  • client.metadata - Metadata operations for any object type
  • client.formats - Format information and management
  • client.search - Search across assets, collections, and other objects

Development

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run tests:
npm test
  1. Run tests in watch mode:
npm run test:watch

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

Releasing New Versions

This project uses semantic-release for automated versioning and publishing. When adding new features or fixing bugs:

Automated Release Process

  1. Make changes and write tests
  2. Use Conventional Commits format for your commit messages:
    • feat: add new feature - for features (minor version bump)
    • fix: resolve bug - for bug fixes (patch version bump)
    • Add BREAKING CHANGE: in commit body for breaking changes (major version bump)
  3. Create a pull request to the main branch
  4. After merging to main, semantic-release will automatically:
    • Determine the next version number based on your commits
    • Generate/update CHANGELOG.md
    • Create a GitHub Release
    • Publish to npm

Manual Release Process

If needed, trigger a manual release:

  1. Go to GitHub Actions → "Version and Release" workflow
  2. Click "Run workflow" and select the version type (patch/minor/major)

For more detailed instructions, see the full release guide.

License

MIT