npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aquanow-users-lambda

v5.41.1

Published

AWS Lambda Functions

Downloads

3

Readme

AWSLambda

AWS Lambda Functions

Dev

Under root directory, run

npm ci

Make sure your editor support eslint and prettier (maybe you'll need to add extensions for them). VS Code (https://code.visualstudio.com/) is suggested here as the editor.

Configure Visual Studio Code

  1. Install Eslint and Prettier extensions

  2. Update settings to make use of the extensions, and let Prettier auto-format the code based on the eslint config file. More specifically: In the top nav bar of VS Code, click Code -> Preferences -> Settings -> {} at the top right coner as shown below. image of vscode

Update the settings as

{
  // Editor
  "explorer.confirmDelete": false,
  "explorer.confirmDragAndDrop": false,
  "window.openFilesInNewWindow": "on",
  "window.zoomLevel": 0,
  "editor.fontSize": 14,
  "files.autoSave": "onFocusChange",
  "editor.formatOnSave": true,
  // Use eslint config as the rules for prettier
  "javascript.format.enable": false, // disable default formatter
  "prettier.eslintIntegration": true
}

Then restart the vs code editor, you should see Prettier automatically format your code, whenver you save your file. vscode auto formatting

Deploy using Serverless

Prerequisites:

####Setup serverless module

First install serverless globally:

npm install -g serverless

####Setup AWS credentials Edit ~/.aws/credentials and ~/.aws/config files under directory. For windows users this is `C:\Users\USERNAME.aws'

credentials file:

[aquaNow-PROD]
aws_access_key_id=...
aws_secret_access_key=...

config file - configure profile name and cloudformation stack region

[aquaNow-PROD]
region=us-east-1

Start to deploy

When deploying the project, a stage variable is used to specify which environment (AWS Account) will the lambdas (as well as other infrastructures) be deployed to. Currently the available stage variables include: PROD, DEV.

Deploy the entire project:

sls deploy --stage PROD

Update a function - this is useful when you want to update and test a single lambda function:

sls deploy --stage PROD --function orderHistory

Miscellaneous

Create API Key for a user

const request = require("request");

const executeAPIUrl = 'https://execute.aquanow.io'; // Adjust your url accordingly

const options = {
  method: 'POST',
  url: `${executeAPIUrl}/apiKey`,
  headers:
   {
     'cache-control': 'no-cache',
     'Content-Type': 'application/json'
   },
  body: {
    userId: 'fuzionadmin', // required | username
    customerId: 'aquanow', // optional
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Run scripts in script folder

Make sure you have correct aws credentials configured on your terminal. You can check aws credentials using aws configure

npm run script scripts/addRfqExchange.js