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

superdev-kit

v1.2.2

Published

A powerful utility kit for developers including status codes, custom Axios, date formatter, and video-to-image tools.

Readme

🔧 superdev-kit

A lightweight utility kit for modern developers. Includes handy tools like:

  • ✅ HTTP Status Code Constants with Messages
  • 🌐 Custom Axios Wrapper (MyApi)
  • 📅 Date Formatter with format and timeAgo support
  • 🎞️ Video-to-Image Frame Cropper
  • ☁️ Amazon S3 Utility – Upload, multipart upload, and delete support

📦 Installation

npm install superdev-kit

🚀 Getting Started

First, import the functions and utilities you need from the package:

import { init, getConfig } from "superdev-kit";

🛠️ Initialize the SDK

To start using the SDK, you need a SuperDev Access Key.
If you don't have one yet, you can get it from https://superdev.in.

Once you have the key, initialize the SDK like this:

import { init, getConfig } from "superdev-kit";

init("your-superdev-access-key"); // Get your key from https://superdev.in

You will see a success log in the console:

✅ superdev-kit initialized

⚙️ Getting Configuration

Use getConfig() to retrieve your current setup and defaults.

async function checkConfigData() {
  let config = await getConfig();
  console.log(config);
}

🧾 Output Structure:

{
  "api_config": {
    "base_url": ""
  },
  "status_code_config": {
    "status_code": true,
    "status_message": true,
    "status_boolean": true
  },
  "s3_config": {
    "bucket_name": "",
    "access_key_id": "",
    "secret_access_key": "",
    "region": "",
    "project_name": ""
  }
}

📦 Status Code Utilities

The getStatus(code, options?) function returns structured information about HTTP status codes.

🛠 Usage

import { init, getStatus } from "superdev-kit";

init("superdev-access-key", {
  status_code_config: {
    status_boolean: true,
    status_code: true,
    status_message: true
  }
});

let status = getStatus(201);
console.log(status);

// Output:
{
  status: true,
  status_code: 201,
  message: "Created"
}

status = getStatus(201, { status_message: true });
console.log(status);

// Output:
{
  message: "Created"
}

status = getStatus(201, { status_boolean: true, status_message: true });
console.log(status);

// Output:
{
  status: true,
  message: "Created"
}

✅ This gives you flexibility to return only the fields you need.

📅 Date Formatting Utility

The formatDate(date, options?) function supports standard formatting and relative time ("time ago") formatting.

🛠 Usage

import { init, formatDate } from "superdev-kit";

init("superdev-access-key", {
  date_config: {
    formatDate: "YYYY-MM-DD HH:mm:ss",
  }, // Overrides the default config
});

let date = formatDate(new Date());
console.log(date);

// Output:
// 2025-05-05 13:19:13

date = formatDate(new Date(), { timeAgo: true });
console.log(date);

// Output:
// just now

date = formatDate(new Date('2023-05-05'), { timeAgo: true });
console.log(date);

// Output:
// 2 years ago

date = formatDate('2023-05-05', { format: 'YYYY-MM-DD' });
console.log(date);

// Output:
// 2023-05-05

date = formatDate('2023-05-05', { format: 'YYYY-MMM-DD HH:mm:ss' });
console.log(date);

// Output:
// 2023-May-05 05:30:00

✅ You can control default and custom formatting per-call.

🌐 Custom Axios Wrapper – MyAPI

The superdev-kit provides a powerful and streamlined API utility MyAPI built over Axios, making HTTP requests cleaner and more consistent. It supports GET, POST, PUT, DELETE, PATCH, and proxying remote media content.

🔧 Configuration

import { init, MyAPI } from "superdev-kit";

init("superdev-access-key", {
  api_config: {
    base_url: "http://example.com",
  },
});

ℹ️ access-token is optional and can be omitted if not required.


📥 GET Request

const getData = async () => {
  const response = await MyAPI.GET("/data", "access-token");
  console.log(response);
};

Response:

{
  "status": 200,
  "message": "Success",
  "data": { /* fetched data */ },
  "error": null
}

📝 POST Request

const createData = async () => {
  const response = await MyAPI.POST("/data", { name: "John Doe" }, "access-token");
  console.log(response);
};

Response:

{
  "status": 201,
  "message": "Created",
  "data": { /* created record */ },
  "error": null
}

🔄 PUT Request

const updateData = async () => {
  const response = await MyAPI.PUT("/data/1", { name: "Jane Doe" }, "access-token");
  console.log(response);
};

❌ DELETE Request

const deleteData = async () => {
  const response = await MyAPI.DELETE("/data/1", "access-token");
  console.log(response);
};

🔧 PATCH Request

const patchData = async () => {
  const response = await MyAPI.PATCH("/data/1", { name: "Jane Doe" }, "access-token");
  console.log(response);
};

🖼️ Proxy Media Request

const proxyMedia = async () => {
  const response = await MyAPI.Proxy_Media("https://example.com/image.jpg", "access-token");
  console.log(response);
};

Response:

{
  "data": <Buffer>, 
  "contentType": "image/jpeg"
}

📎 This is useful for bypassing CORS and serving external assets via your own backend securely.


🔐 Note: All methods accept an optional access token which, if provided, will be sent via Authorization: Bearer header.

🎞️ Video Frame to Image Cropper – convertVideoToThumb

Easily extract thumbnails from video files using convertVideoToThumb. This utility provides multiple configuration options such as capture time, frame count, range slicing, and optional file saving. It's suitable for preview generation, media summarization, or visual indexing.

📦 Import & Usage

import { convertVideoToThumb } from "superdev-kit";

📸 Capture a Single Frame at Specific Time

await convertVideoToThumb('test.mp4', {
  captureTime: 5 // Capture frame at 5 seconds
});

🕒 Extract Frames Between Time Range

await convertVideoToThumb('test.mp4', {
  startTime: 5, // Start at 5 seconds
  endTime: 10   // End at 10 seconds
});

🔢 Generate a Fixed Number of Thumbnails

await convertVideoToThumb('test.mp4', {
  count: 5 // Generate 5 thumbnails from start to end of video
});

🧠 Advanced: Combine Time Range + Count

await convertVideoToThumb('test.mp4', {
  startTime: 5,
  endTime: 10,
  count: 5
});

💾 Save Thumbnails to Disk

await convertVideoToThumb('test.mp4', {
  startTime: 5,
  endTime: 10,
  count: 5,
  savePath: 'thumbnails' // Optional path to save images
});

📤 Output

  • If savePath is provided:
    Returns an array of absolute file paths where thumbnails are saved.

  • If savePath is omitted:
    Returns an array of in-memory image Blob files (useful for uploading or further processing without writing to disk).

// Example Output
[
  Blob, Blob, Blob, Blob, Blob
]

// OR

[
  '/absolute/path/to/thumbnails/thumb_1.jpg',
  '/absolute/path/to/thumbnails/thumb_2.jpg',
  ...
]

📝 Notes

  • Works well with local .mp4, .mov, .webm, and similar formats.
  • Can be used in Node.js environments for automated media processing pipelines.
  • Ensure the input video exists and is readable at the specified path.

💡 Use this for generating video highlights, YouTube-style thumbnails, or short previews.

☁️ Amazon S3 Integration – AWS_S3

superdev-kit provides built-in support for uploading and managing files on Amazon S3, with both single and multipart upload capabilities. This makes it ideal for managing media assets, large videos, and general file storage.


🔧 Initialization

import { init, AWS_S3 } from "superdev-kit";

init("your-superdev-access-key", {
  s3_config: {
    region: "your_region",
    access_key_id: "your_access_key",
    secret_access_key: "your_secret_key",
    bucket_name: "your_bucket_name",
    project_name: "your_project_name"
  }
});

📤 Upload a Single File

const uploadFile = async (file) => {
  try {
    const response = await AWS_S3.uploadFile(
      file,
      (progress) => {
        console.log(`Uploaded ${progress}%`); // Optional progress callback
      },
      "test-media" // Optional folder name
    );
    console.log(response);
  } catch (error) {
    console.error(error);
  }
};

✅ Output

{
  "Bucket": "your_bucket_name",
  "Key": "your_project_name/test-media/your_file_name",
  "ETag": "file_etag",
  "VersionId": "file_version_id",
  "ServerSideEncryption": "AES256",
  "Location": "https://your_bucket.s3.amazonaws.com/your_project_name/test-media/your_file_name",
  "KeyId": "your_file_key_id"
}

🎥 Upload a Large Video (Multipart Upload)

const uploadLargeVideo = async (file) => {
  try {
    const response = await AWS_S3.uploadLargeVideo(
      file,
      (progress) => {
        console.log(`Uploaded ${progress}%`); // Optional progress callback
      },
      "videos" // Optional folder name
    );
    console.log(response);
  } catch (error) {
    console.error(error);
  }
};

✅ Output (Same structure as above)

{
  "Bucket": "your_bucket_name",
  "Key": "your_project_name/videos/your_file_name",
  "ETag": "file_etag",
  "VersionId": "file_version_id",
  "ServerSideEncryption": "AES256",
  "Location": "https://your_bucket.s3.amazonaws.com/your_project_name/videos/your_file_name",
  "KeyId": "your_file_key_id"
}

🗑️ Delete File from S3

const deleteFile = async (key) => {
  try {
    const response = await AWS_S3.deleteFile(key);
    console.log(response);
  } catch (error) {
    console.error(error);
  }
};

🔑 Input

  • key: Full object key (e.g. "your_project_name/test-media/your_file_name")

✅ Output

true

💡 Use Cases

  • Upload images, PDFs, and static files
  • Upload large videos with real-time progress tracking
  • Automate file cleanup by deleting unused assets
  • Integrate with other features like video thumbnail generation or user uploads

🔒 Ensure that your AWS IAM policy has permissions for s3:PutObject, s3:GetObject, and s3:DeleteObject for the configured bucket.