0.4.3 • Published 4 years ago

soak-js v0.4.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

soak-js

On-the-fly hydration for FaaS. No more input & output size limits.

Install

npm i soak-js

Basic Usage

Before exporting, wrap your function in soak

AWS Lambda

const soak = require('soak-js');

const myFunction = (event, context, callback) => ({ foo: 'bar' })

exports.handler = soak(myFunction, {
  bucket: 'some-s3-bucket-for-stashing'
})

Google Cloud Functions

const soak = require('soak-js');

const myFunction = (req, res) => ({ foo: 'bar' }) // don't use res.json()

exports.myFunction = soak(myFunction, {
  bucket: 'some-gcloud-bucket-for-stashing
})

Pass it unlimited inputs

// myBucket/largePayload.json
{ 
  "foo": "bar",
  "baz": 123
}
// invoke it with:
{ a: 1, _pointer: 'largePayload.json' }

// your function sees:
{ a: 1, foo: 'bar', 'baz': 123 }

Create unlimited outputs

return { almost: 'too', large: 'output' }
// => { almost: 'too', large: 'output' }

return { too: 'large', json: 'output' }
// => { _pointer: stashedOutputKey.json }

Platforms

Amazon AWS LambdaGoogle Cloud Functionsusing soak-js
Invocation payload6 MB (sync)10 MBunlimited
256 KB (async)unlimited
Response6 MB (sync)10 MBunlimited
256 KB (async)unlimited

Licence

MIT

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.3.9

4 years ago

0.3.10

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.4.0

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago