A version of goldwasher that runs as a module on AWS Lambda.
Last updated 5 years ago by alexlangberg .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install goldwasher-aws-lambda 
SYNC missed versions from official npm registry.


npm version Build Status Coverage Status Code Climate

Dependency Status devDependency Status peerDependency Status

A version of goldwasher that runs as a module on AWS Lambda. Uses goldwasher-needle for requests.


This module installs as a module on AWS Lambda, as a zip file. You can either just download the zip from /dist and upload it via your AWS console or install it via aws-cli. The first one might not always work so the method with aws-cli described below is recommended:

npm install goldwasher-aws-lambda
cd node_modules/goldwasher-aws-lambda/dist/
aws lambda create-function --function-name goldwasher --timeout 60 --zip-file fileb://

You can of course replace goldwasher with your name of choice and 60 with a lower timeout if necessary.

If you later need to overwrite it and the function name already exists on AWS, use this instead:

aws lambda update-function-code --function-name goldwasher --zip-file fileb://


The module accepts the usual parameters of goldwasher-needle with the exception that the url and options parameters have been merged. This simply means that the first parameter, url, has been removed and must instead be added as a property on the options parameter:

  url: '',
  goldwasher: {
    selector: 'h1'

See how to use this in the examples below or simply paste it as a sample event in the AWS console.


If you feel like changing the code and have installed the development dependencies, you can automatically build a new zip file from the main folder:

gulp zip

This will create a new zip that can be installed with the commands mentioned under installation.


In this example we will show how to consume the Lambda function from a client. First, install the aws-sdk:

npm install aws-sdk

In this example, we will use a config file for our AWS credentials. Remember to replace the values below with your own.


It is extremely important that you do not push this file to your git repository or any other public place. I highly recommend using environment variables instead. I also recommend creating a user on AWS that only has the permission AWSLambdaRole to run this.


	"accessKeyId": "akid",
	"secretAccessKey": "secret",
	"region": "us-east-1"


var AWS = require('aws-sdk');


var lambda = new AWS.Lambda();

	FunctionName: 'goldwasher',
	Payload: JSON.stringify({url: ''})
function(error, data) {
	if (error) {

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

5 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (16)
Dependents (2)

Copyright 2014 - 2016 © |