jsbundle-s3

jsbundle-s3 is now part of the jsbundle package

npm install jsbundle-s3
13 downloads in the last month

jsbundle-s3

Bundle, minify, and upload your JS code to Amazon's Simple Storage Service (S3).

Usage:

[JSBUNDLE_ENV=env] jsbundle-s3 <node_package_dir> [--bundle-version=version]

The options are basically identical to the jsbundle options.

There are two major differences:

  1. the --bundle-version option, which lets you specify a version string for the uploaded bundle. It defaults to a millisecond timestamp.
  2. the "s3" key in jsbundle.json, which is as follows:

    "s3": {
     "accessKeyId": "my_key_id",
     "secretAccessKey": "my_secret_access_key",
     "bucketName": "my_bucket_name",
     "afterUpload": "redis-cli -p 6379 hmset jsbundle.urls $NAME $URL"
    }

    afterUpload is optional, and runs a shell command with 3 variables set after S3 upload succeeds:

  3. $NAME — the file name (taken from the bundled package's package.json), e.g.: mypackage.js

  4. $VERSION — the version string, e.g.: 1337644600297
  5. $URL — the url, without a protocol, of the uploaded file, e.g.: //s3.amazonaws.com/mybucket/1337644600297/mypackage.js
npm loves you