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-client

v0.1.59

Published

Node.js client module to work with file storage asset-server

Downloads

21

Readme

Asset-server-client

Client module for asset-server (https://github.com/aprnd/asset-server)

Requirements

  • Node.JS >= 0.10.21

Installing/testing

  • Install asset-server
  • Run npm install after getting asset-server-client
  • Go to test/
  • Assuming your server is running locally, you can create a bucket with:
    $ node createbucket.js local.asset-server.com 5604 "Testing bucket" testerbucket SomeReallyPrivateBucketCreationKey
    ------
    Creating bucket Testing bucket
    ------
    STATUS: 200
    HEADERS: {"content-type":"application/json","content-length":"159","date":"Sat, 22 Mar 2014 16:52:38 GMT","connection":"keep-alive"}
    SUCCESS creating bucket testerbucket (named SomeReallyPrivateBucketCreationKey) on local.asset-server.com:5604
    BODY: {"subdomain":"testerbucket","name":"Testing bucket","apiKey":"66a26c035f773c3b63c4206faf484b94337f2c79","apiSecret":"f6475557309a0e3ffc320f2e13a8a82f6a0e3df8"}
  • It should return an api key and a secret that you can use to access your new bucket like so:
    $ node put.js local.asset-server.com 5604 testerbucket 66a26c035f773c3b63c4206faf484b94337f2c79 f6475557309a0e3ffc320f2e13a8a82f6a0e3df8 napoleon.jpg /test/napoleon.jpg image/jpg
    ------
    Testing PUT upload of napoleon.jpg (of type image/jpg) to testerbucket.local.asset-server.com:5604/test/napoleon.jpg
    ------
    { key: '/test/napoleon.jpg',
      passedHeaders: { 'Content-Type': 'image/jpg', 'Content-Length': 19397 },
      headers: 
       { Date: 1395507882053,
         'Content-Length': 19397,
         'Content-Type': 'image/jpg',
         Authorization: 'Basic QVdTIDY2YTI2YzAzNWY3NzNjM2I2M2M0MjA2ZmFmNDg0Yjk0MzM3ZjJjNzk6NWU1MzFmMjVjNDY0MTJhMDFhMWQ2NjRjODVjNDVjYTZmOTQ5Zjc4OA==' },
      httpVerb: 'PUT',
      opts: 
       { domain: 'local.asset-server.com',
         port: '5604',
         bucket: 'testerbucket',
         apiKey: '66a26c035f773c3b63c4206faf484b94337f2c79',
         apiSecret: 'f6475557309a0e3ffc320f2e13a8a82f6a0e3df8',
         host: 'testerbucket.local.asset-server.com',
         socketTimeout: 10000,
         expiryMinutes: 10 },
      
      [ ... ]

      headers: 
       { 'x-amz-version-id': '51f7ea03dfd0611115a8aad88c8130c4',
         date: 'Sat, 22 Mar 2014 16:54:42 GMT',
         connection: 'keep-alive',
         'transfer-encoding': 'chunked' },

      [ ... ]

      SUCCESS PUT testerbucket.local.asset-server.com:5604/test/napoleon.jpg
  • Try loading http://testerbucket.local.asset-server.com:5604/test/napoleon.jpg in your browser. You can also load versions with the query string ?versionId returned from the PUT request header x-amz-version-id. For example in this case, http://testerbucket.local.asset-server.com:5604/test/napoleon.jpg?versionId=51f7ea03dfd0611115a8aad88c8130c4.