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 🙏

© 2024 – Pkg Stats / Ryan Hefner

asset-server

v0.1.61

Published

A lean RESTful Amazon S3-like asset server that supports subdomain buckets, content hashing and versioning, streaming files directly to the the local filesystem.

Downloads

23

Readme

Asset-Server: Lightweight, Amazon S3-like, RESTful asset server for networked applications.

Asset-Server was built as an image host for a project that needed a S3-like, quick and reliable public file host that could be rolled into a package to be hosted onsite in some use cases, and being replaced by Amazon S3 in others. Obviously you can store any sort of files in it. AS is meant to act as a public-facing server that you can store both static (like website, marketing, e-mail and other assets that might get updated but need the same URL) and user-generated/uploaded content in. Runs with the help of Node.JS, Restify and MongoDB.

Tested with OSX 10.9.2 and Debian GNU/Linux.

Changes

  • 0.1.60 (Jan 17 2015):
  - Etag support

Download

Clone source to download.

Requirements

  • Node.JS >= 0.10.21
  • MongoDB

Features:

  • RESTful interface for direct blob management (GET/PUT/HEAD/DELETE /folder/file.ext)
  • Subdomain buckets, ie. bucketname.asset-server.com.
  • Metadata stored in MongoDB.
  • Content transfer verification via MD5 hashes.
  • SSL support.
  • Automatic file versioning; just rewrite a file and the old one is archived.
  • API access and secret keys for verification in S3-like fashion.
  • Files are streamed direct to disk instead of being buffered in memory.

Asset-Server does not support:

  • File processing like image cropping, resizing, etc. Do that before uploading.
  • Fetching file ranges. It is not meant as a streaming media repository.
  • ACL (Access Control Lists). It is meant as a public-facing server and private files are not supported.

Asset-Server will, in the future..

  • Have a more thorough bucket API, so you can manage your bucket through REST.
  • Support more metadata storage options than MongoDB; namely Redis.

Installing

  • Clone from source or install through npm.
  • Run npm install.
  • Decide on an environment name in the environment variable AssetServerEnv. If you're running a local instance, local is a good bet.

Configuration

  • Copy config.local.json.example to config.yourenv.json.
  • Change the hostname (domain, line 8). *.local.asset-server.com always points to 127.0.0.1 from DNS, so you can use that for local testing.
  • Change the bucket creation key (bucketkey, line 14). This is used to create new buckets to upload to.
  • If you wish, change storagelocation, line 19. This is the directory files are stored in. Make sure the directory exists and is writable by the user running the server.

Running

Run app.js to start the server. If you want to set the environment name on the fly, you can run AssetServerEnv=yourenv node app.js.

Create a bucket

To create a bucket, send a POST request to /bucket with the following headers:

"name": "Your Bucket's Name",
"subdomain": "subdomain",
"bucketkey": "yourbucketkey"

The response body should contain JSON with your API key and secret that you can use to access the bucket.

Testing with client module & app

asset-server-client

Link: https://github.com/aprnd/asset-server-client

Node.js client module to interact with a bucket. Includes test command-line scripts.

asset-server-desktop

Link: https://github.com/aprnd/asset-server-desktop

Alpha desktop client to upload files to an asset-server instance. Built on top of node-webkit.

alt text

Credits and contributions

Contributions are welcome! Please note that the point is to keep the server lean and light, so besides the features listed above, there should be a very good reason to have the server do something else.

Juho Hietala

Applied Research & Development

E-mail: [email protected] Twitter: http://www.twitter.com/appliedrnd