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

create-demo-assets

v1.0.13

Published

Generate and refresh AWS S3 presigned URLs for AudioShake demo assets. A lightweight Node.js command-line tool that lists S3 media assets, generates presigned URLs, and outputs a `demo-assets.json` file for easy integration into your audio, video, or SDK

Readme

AWS Demo Assets Tool

A lightweight Node.js command-line tool that lists S3 media assets, generates presigned URLs, and outputs a demo-assets.json file for easy integration into your audio, video, or SDK demos.
Designed for developers who regularly work with secure Amazon S3 buckets to manage and refresh demo content.

Node.js AWS SDK v3 License

Requirements

  • Node.js ≥ 18
  • AWS credentials with access to your demo-assets bucket
  • Either local or global installation of AWS SDK dependencies (not both)

Features

  • Generates presigned URLs with secure expiration (default: 12 hours)
  • Automatically lists files from any S3 bucket path
  • Outputs a consistent, ready-to-use JSON structure
  • Works with standard AWS CLI credentials and profiles
  • Includes an NVM-aware global wrapper for cross-shell compatibility
  • Ideal for AudioShake or similar SDK demos where assets need periodic refreshing

TL;DR Quick Start

The new create-demo-assets CLI can be run instantly with NPX — no manual dependency or wrapper installation required.

# First-time setup (interactive)
npx create-demo-assets --setup

# Once installed you can reference it without the npx

# List your current demo assets
create-demo-assets --list

# Upload a local file
create-demo-assets --upload ./file.mp3

Configuration

During setup, you’ll be prompted for:
	•	AWS Region
	•	S3 Bucket name
	•	S3 Prefix (e.g., demo-assets/)
	•	AWS Profile name

The tool saves your configuration locally (per project) or globally (for all projects).
You can manage it anytime with:

# Show current configuration
create-demo-assets --showConfig

# Reset and reconfigure
create-demo-assets --resetConfig

If your AWS credentials are missing or invalid, you can configure them manually:

aws configure --profile <your-profile>

Then re-run setup:

create-demo-assets --setup

💡 The tool validates your AWS credentials automatically during setup, ensuring you’re ready to upload and list assets immediately.

AWS Credential Setup

1. Configure AWS Credentials

This command lists all configured AWS credential profiles available on your system.

# list existing profiles
aws configure list-profiles

% dev
amplify-profile-dan
admin

Ensure you have AWS credentials with access to your demo-assets bucke. This command will use them to create a reusable AWS profile.

# Create a profile
aws configure --profile admin
# Region: us-east-1
# Output: json

2. Run the Tool

At it's simplest, this will generate a JSON file containing all your aws assets in a bucket and prefix location.

Generate demo-assets.json

create-demo-assets

This command:

  • Lists all objects in your configured S3 folder
  • Generates presigned URLs with the correct signer region
  • Saves a fresh demo-assets.json in your current working directory

Example output:

{
  "assets": [
    {
      "src": "https://audioshake.s3.us-east-1.amazonaws.com/demo-assets/example.wav?...",
      "title": "example.wav",
      "format": "audio/wav",
      "expiry": "2025-10-14T09:45:00.000Z"
    }
  ]
}

Usage Options

AudioShake Demo Asset Builder (v2)
----------------------------------
Usage:
  npx create-demo-assets [options]
  create-demo-assets [options]

Options:
  --upload <file>             Upload a single file to s3://${BUCKET}/${PREFIX}
  --uploadDir <directory>     Upload all supported files from a directory
    --public                  Generate public URLs without pre-signed query strings (requires public bucket)
  --cloudfront                Generate public URLs using the cloudfront distribution base url
  --type <ext[,ext]>          Optional. Filter uploads or JSON output by file type (e.g., mp3,mp4,wav)
  --list                      List existing assets in the bucket (no JSON generation)
  --hours <n>                 Set the presigned URL expiry (default: 12h)
  --profile <aws-profile>     Use a specific AWS profile (default: admin)
  --help, -h                  Show this help message
  --setup                     Run interactive setup for configuration
  --showConfig                Display current configuration
  --resetConfig               Remove both local and global configuration files

Examples:
  create-demo-assets --upload ./song.mp3
  create-demo-assets --uploadDir ./assets --type=mp3,mp4
  create-demo-assets --type=mp3,mp4
  create-demo-assets --list
  create-demo-assets --cloudfront https://demos.spatial-explorer.com

Supported File Types:
  Audio: mp3, wav, m4a, aac
  Video: mp4, mov
  Text: txt, md, srt, json, csv, xml
  Images: jpg, jpeg, png, gif, webp

💡 To extend support, edit the mimeMap inside scripts/create-demo-assets.mjs.

Docs & Updates:
  https://github.com/AudioExplorer/AWS-Demo-Assets-Tool

Repository Structure

/bin
 └── create-demo-assets       → global wrapper (NVM-compatible)
/scripts
 └── create-demo-assets.mjs   → Node script using AWS SDK v3
/docs
 └── tutorial.md              → detailed setup and usage guide

Why This Exists

When working with AudioShake APIs or other SDKs, demo assets often live in protected S3 buckets.
This tool eliminates the need to manually generate presigned URLs every time they expire, enabling safe, repeatable integration of media in test apps or demo environments.


Troubleshooting

  • SignatureDoesNotMatch — Ensure your bucket region is correct (set to us-east-1 if LocationConstraint is null).
  • Cannot find package '@aws-sdk/client-s3' — Confirm packages are globally installed for your current NVM Node version.
  • Permission denied — Use sudo chmod +x /usr/local/bin/create-demo-assets to make the wrapper executable.

Maintained By

Dan Zeitman

AudioShake Developer Website
https://developer.audioshake.ai


Suggested Topics:
nodejs, aws, s3, cli, devtools, audioshake, presigned-url, nvm, automation