nearst / laconia

Create well-crafted serverless applications, effortlessly.
http://laconiajs.io
Apache License 2.0
326 stars 30 forks source link

Add type text to the s3 input converter #801

Closed Ankcorn closed 3 years ago

Ankcorn commented 3 years ago

I have the requirement to parse a file that is not JSON but doesn't want to use streams as the file is never exceptionally large.

You would use this text adaptor by doing this



const laconia = require('@laconia/core');
const s3 = require('@laconia/adapter').s3({ inputType: "text" });

const app = async(file) => {
    console.log({ file });
};

exports.handler = laconia(s3(app));
ceilfors commented 3 years ago

@all-contributors please add @Ankcorn for code

allcontributors[bot] commented 3 years ago

@ceilfors

I've put up a pull request to add @Ankcorn! :tada:

ceilfors commented 3 years ago

Hey @Ankcorn. Thanks for raising this PR. This change looks good. Would you mind removing all of the package.json changes so that I can merge this? The package versioning is currently managed by lerna, therefore it'll be automatically bumped in the release.

I'll be away, for finally a holiday, in the next 2 weeks, so I won't be able to merge this as quickly you'd expect.

@laconiajs/maintainers I'm not sure if any of you are still active, if you are feel free to help merge this one :)

Ankcorn commented 3 years ago

Thanks @ceilfors I have reverted those package.json changes. Have a great holiday.

ceilfors commented 3 years ago

@Ankcorn It'll probably be easier for me to merge if you remove the commit for package-lock.json as well, it's a bit hard to review these auto-generated files.

Optionally it'll be great if you can make the CI test pass. I think there's a missing test for createS3EventAdapter. Getting there!

Ankcorn commented 3 years ago

Can't seem to get the acceptance test package-lock dif to go away. But have added that test. I probably should have kept my install in an individual commit.

ceilfors commented 3 years ago

@Ankcorn Released under v1.12.0. Thanks! Would you be interested to update our docs as well? https://github.com/laconiajs/website

Ankcorn commented 3 years ago

Thanks, Yeah of course :)