Git Product home page Git Product logo

node-s3-npm's Introduction

Disclaimer

i do not recommend using this module in it's current state. it uses old and unsupported npm apis and it doesnt use scopes for private namespaces.

i have some much better ideas of how to put something like this together but no time at the moment. this should at least work and i will accept pull requests :)

npm Build Status

node-s3-npm

Publish packages to your own s3 bucket, install and resolve nested private or public deps without replacing or hacking npm.

Install

npm install -g s3npm

configure #TODO im working on this now.

s3npm configure

following the setup you just use npm normally

npm install

to setup a package update your package.json file to include

  • s3Dependencies
  • depend on s3npm
  • and run s3npm in the postinstall hook
{
  "s3Dependencies":{
    "packagename":"~x.x.x-anysemver"
  },
  "dependencies":{
    "s3npm":"~x.x.x"
  },
  "scripts":{
    "test":.....
    "postinstall":"s3npm install"
  },
}

WORKFLOW

publishing a module to your bucket

cd to your module

s3npm publish

I attempted a solution without s3npm globally. see prepublish footnote.

to install a module that depends on s3 modules

you just use npm install normally, but the projects package.json will need a postinstall hook that executes s3npm install

DETAILS

configure!

s3npm looks for the most local .s3npm.json file from the root of the package that you are installing or from process.cwd()

to create the json file you may.

s3npm configure

this will ask you for your

  • amazon keys if not in your environment
  • the optional s3 bucket for your project
  • and the directory to install the config information.

if your aws credentials are not provided they will be read from the environment. #TODO if you do not specify a default bucket your package name must be prefixed with the bucket name delimited by / bucketname/packagename

user managmanet with iam. oh my! see footnote.

But automated deployments will probably want to create the file manually.

Add an .s3npm.json to your project directory

{ "defaultBucket": "bucket-name"
, "key": "aws-key"
, "secret": "aws-secret"
, "dependenciesKey": "optional package.json key for s3 deps, defaults to 's3Dependencies'"
}

depend!

add s3npm as a dependency for your private module

footnotes

prepublish

i attempted to use the prepublish hook to trigger s3npm publish and exit with a 1 to prevent the publish to the real registry.

  • prepublish is run on every npm install and i cannot find out that the context of the hook is install rather than publish. you probably dont want to publish every install so.. failure.

iam user accounts

i feel that its important to be able to manage user accounts and access but IAM is hard. i started a module called iamhard but have not had time to finish it. this has to work awesome if its added at all.

npm dependency

npm depends on many modules and the install is a bit slow. ideally i would not have to depend on it considering that npm is installed with all node deployments.

  • I should just be able to use it. With that i would have to worry about version issues etc probably bad.
  • with tests to implement the portions of npm that i need but i may skew from npm and no one likes bugs from divergent implementations.

node-s3-npm's People

Contributors

dstokes avatar soldair avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.