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 🙏

© 2021 – Pkg Stats / Ryan Hefner

fleet-cli

v0.2.19

Published

Function-Level Entrypoint and Endpoint Technology

Downloads

8

Readme

Function-Level Entrypoint and Endpoint Technology Command Line Interface for NodeJS

fleet is a platform that enables quick and easy management and provisioning of serverless applications.

fleet-cli for NodeJS allows you to quickly create, deploy, and manage serverless applications to cloud providers such as AWS. You can easily create an AWS Lambda function, create an AWS S3 static hosted website for a front-end, and centrally manage these resources.

View Roadmap Notes

View Release Notes

Pre-requisites

  • Your environment will need access to your AWS account in order to deploy
  • NodeJS (8.5+)

Installation

  • npm i -g fleet-cli

Usage

Calling fleet-cli create-fleet <appName> in your terminal will initialize your local fleet environment. This environment will come with a fleet.json configuration file and will create your application's routes directory. Note: You can specify creating your fleet for a set of regions with the --region tag or for all available regions with the --global tag.

# fleet-cli create-fleet <appName>
$ fleet-cli create-fleet myFleetApp

Once your environment has been created, you can make a new route using the CLI. A route is a serverless application that runs your code and can be triggered by various services, such as an API Gateway. Call the new-route command and supply the unique route name, definition of the route, and the type of route (e.g. GET, POST). The route definition provides your API with a URL structure (e.g. http://example.com/admin/users/1 would be admin/users/:id and would define a route for getting users by their ID). The unique route name will provide an identifier for this route and will be used to create your route's local code folder.

# fleet-cli new-route <routeName> <routeDefinition> <type>
$ fleet-cli new-route getFleetCount fleetcount GET

This will create a new folder in your local environment called routes/getFleetCount with a route stub ready for editing and deployment.

# Within routes/getFleetCount directory
$ index.js package.json

At this point you can modify the code within this route's index.js to your liking. If you want to add node modules, you can cd into the new directory and npm install as usual. You can deploy this route to your remote fleet application using the fleet CLI. This will setup various services such as API Gateway, Lambda, IAM Roles/Policies, etc.

# fleet-cli deploy-route <routeName>
$ fleet-cli deploy-route getFleetCount
$ getFleetCount route has been deployed to your application at http://example.com/fleetcount

You can update your remote route at anytime by using the same fleet-cli deploy-route <routeName> command.

You can run a route locally using the fleet-cli run-route <routeName> command.

$ fleet-cli run getFleetCount
Hello new Route!

You can create a new website using the fleet-cli new-website <websiteName> command. This will produce a source directory for your site within the websites folder of your fleet project. You can add/edit files for your site here, including running package managers such as ng.

$ fleet-cli new-website diceRollerSite

Once you are satisifed with the content of your site, you can deploy it using the fleet-cli deploy-website <websiteName> command.

$ fleet-cli deploy-website diceRollerSite

Undeploy

To remove a deployed route, simply call the undeploy-route command. This will remove the specified route and any unused resources.

$ fleet-cli undeploy-route getFleetCount

To delete an entire fleet, call the delete-fleet command. This will remove all resources.

$ fleet-cli delete-fleet

Inspect

To get information about your current fleet application's routes, you can use the following commands:

$ fleet-cli inspect-routes
╔═══════════════╤════════════╤════════════════════════╤══════╤══════════╗
║ NAME          │ API PATH   │ FILE PATH              │ TYPE │ DEPLOYED ║
╟───────────────┼────────────┼────────────────────────┼──────┼──────────╢
║ getFleetCount │ fleetcount │ ./routes/getFleetCount │ GET  │ true     ║
╚═══════════════╧════════════╧════════════════════════╧══════╧══════════╝
$ fleet-cli inspect-route getFleetCount --property url
http://example.com/fleetcount

Using the fleet inspect commands will help you manage your application, allowing you to track deployment information, versioning, and more.

Build fleet-cli-nodejs Locally

To build fleet-cli from source and run locally, run the following commands:

# clone the repo
$ git clone https://github.com/fleet-io/fleet-cli-nodejs.git

# cd into the cloned directory
$ cd fleet-cli-nodejs

# install npm modules
$ npm install

# run fleet-cli using node
$ node .\bin\fleet-cli --version