Giter Club home page Giter Club logo

node-cloudfront's Introduction

Amazon CloudFront client for Node.js

Implements all the functionality in CloudFront version 2012-05-05. In addition, is there a getPrivateUrl method to create signed urls.

Please take a look at the examples folder.

How to Install

npm install cloudfront

How to use

var cloudfront = require('cloudfront');

var cf = cloudfront.createClient('access key id', 'access key secret');

cf.listDistributions(function(err, list, info) {
  console.log('Is truncated?', info.isTruncated ? 'yes' : 'no');
  console.log(list);
});

Using STS session token

var cloudfront = require('cloudfront');

var cf = cloudfront.createClient('access key id', 'access key secret', 'session token');

...

Please take a look at the examples in the example folder.

License

MIT

node-cloudfront's People

Contributors

jtblin avatar mente avatar patrickjs avatar tellnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-cloudfront's Issues

Example doesn't work

Example provided in readme doesn't work

/home/avasilenko/node_modules/cloudfront/lib/index.js:50
  info.list = body[listKey].map(function(data) {
                            ^
TypeError: Object #<Object> has no method 'map'
    at listBodyToInfo (/home/avasilenko/node_modules/cloudfront/lib/index.js:50:29)
    at /home/avasilenko/node_modules/cloudfront/lib/index.js:248:16
    at Parser.<anonymous> (/home/avasilenko/node_modules/cloudfront/lib/index.js:105:7)
    at Parser.emit (events.js:67:17)
    at Object.onclosetag (/home/avasilenko/node_modules/cloudfront/node_modules/xml2js/lib/xml2js.js:120:24)
    at emit (/home/avasilenko/node_modules/cloudfront/node_modules/xml2js/node_modules/sax/lib/sax.js:322:32)
    at emitNode (/home/avasilenko/node_modules/cloudfront/node_modules/xml2js/node_modules/sax/lib/sax.js:327:3)
    at closeTag (/home/avasilenko/node_modules/cloudfront/node_modules/xml2js/node_modules/sax/lib/sax.js:540:5)
    at Object.write (/home/avasilenko/node_modules/cloudfront/node_modules/xml2js/node_modules/sax/lib/sax.js:949:29)
    at IncomingMessage.<anonymous> (/home/avasilenko/node_modules/cloudfront/lib/index.js:92:24)
$  node -v
v0.6.13

Unhandled 'error' event

There is no listener for error events so the process will crash in case of socket error e.g.

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1092:19)
    at TLSSocket.g (events.js:286:16)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

is this still maintained?

I want to specify max and default TTL cache behavior, but looking at the src there's only mapping for minTTL

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.