0.1.1 • Published 12 years ago

fortknox v0.1.1

Weekly downloads
11
License
-
Repository
github
Last release
12 years ago

FortKnox

Enhancement methods to Knox the AWS s3 module, with these methods you can create a bucket, remove a bucket, create a website and activate a standard website policy.

Install

npm install fortknox

Api Methods

Fort Knox supports all methods that knox supports and adds the following methods:

  • createBucket
  • deleteBucket
  • createWebsite
  • deleteWebsite
  • enablePolicy
  • disablePolicy

fortknox.createBucket createBucket(fn)

fortknox.createBucket builds a new bucket based on your client options.

fortknox = require 'fortknox'

client = fortknox.createClient
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.createBucket (err, resp) -> console.log resp.statusCode

fortknox.deleteBucket deleteBucket(fn)

fortknox.deleteBucket removes a bucket based on your client options.

fortknox = require 'fortknox'

client = fortknox.createClient
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.deleteBucket (err, resp) -> console.log resp.statusCode

fortknox.createWebSite createWebSite(fn)

fortknox.createWebSite convert bucket into a website.

fortknox = require 'fortknox'

client = fortknox.createClient
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.createWebSite (err, resp) -> console.log resp.statusCode

fortknox.deleteWebSite deleteWebSite(fn)

fortknox.deleteWebSite remove website config from a bucket.

fortknox = require 'fortknox'

client = fortknox.deleteWebSite
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.deleteWebSite (err, resp) -> console.log resp.statusCode

fortknox.activatePolicy activatePolicy(fn)

fortknox.activatePolicy activate policy config from a bucket.

fortknox = require 'fortknox'

client = fortknox.activatePolicy
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.activatePolicy (err, resp) -> console.log resp.statusCode

fortknox.deactivatePolicy deactivatePolicy(fn)

fortknox.deactivatePolicy activate policy config from a bucket.

fortknox = require 'fortknox'

client = fortknox.deactivatePolicy
  key: 'FOO'
  secret: 'BAR'
  bucket: 'www.foobar.com'

client.deactivatePolicy (err, resp) -> console.log resp.statusCode

Testing

npm test

Contribute

Pull Requests welcome!

Thanks to

License

see LICENSE

0.1.1

12 years ago

0.1.0

12 years ago