dhdbstjr98 / aws-lambda-import.js

AWS Lambda Import Solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aws-lambda-import.js

AWS Lambda Import Solution

Installation using npm install is not possible in AWS Lambda. This program helps you perform npm install in your local environment and then load it easily from AWS Lambda.

Usage

  1. npm install -g webpack in your local environment
  2. git clone and npm install
  3. npm install something
  4. edit src/import.js
module.exports = {
	something:require('something')
}
  1. webpack
  2. add import.js in your lambda environment and paste dist/import.js code
  3. Paste the code below at the top of index.js in your lambda environment
const imports = require('./import')['import'];
const something = imports.something

About

AWS Lambda Import Solution


Languages

Language:JavaScript 100.0%