
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@kazi-faas/cli
Advanced tools
Serverless functions allow developers to quickly implement and deploy functionality that can be invoked via HTTP requests. This CLI enables easy development and deployment of serverless JS functions to Knative. Currently supports deploying only Node.js fu
Serverless functions allow developers to quickly implement and deploy functionality that can be invoked via HTTP requests. This CLI enables easy development and deployment of serverless JS functions to Knative. Currently supports deploying only Node.js functions, but hopefully include a Deno runtime in the near future (perhaps you can sponsor this feature. Check out the sponsors pages
Knative provides reduced operational overhead, auto-scaling, automatic domain and TLS provisioning. Add functions to it, you get the features of serverless functions that has become popular and loved among developers.
.env
file..env
is saved in a ConfigMap and used at runtime.npm i -g @kazi-faas/cli
This section will show you how quick it is to create and deploy a basic function that returns a JSON string value. The first thing to do is to install the CLI using the command npm i -g @kazi-faas/cli
. After that's done, the CLI should be accessible with the kazi
command. When you run kazi
in the terminal without any commands or flags, it will print out the help text with a list of possible commands.
With the CLI installed, create a new function using the command below:
kazi create hello --registry=YOUR_REGISTRY_NAMESPACE
Replace
YOUR_REGISTRY_NAMESPACE
with the URL to your container registry. For example, docker.io/pmbanugo.
A new Node project will be created in a directory called hello. In this directory, you have the following files.
config.json
index.js
package.json
The config.json file contains the configuration used to build and deploy the function. The index.js file is the entry point into the application. It exports a function that returns a string.
module.exports = (req, res) => "Welcome to Kazi";
When the function runs, it'll return a 200 status code with the JSON string Welcome to Kazi
.
Now, open your terminal and deploy the function by running the command kazi deploy
from the project's path. This will build the project, push it to your container registry, and then deploy it to Knative. If it successfully deploys to Knative, you will see a success message and a URL to access to function.
Now open the URL in a browser and you should see Welcome to Kazi
displayed as a response. That's how quick it takes to create and deploy a function.
There's not so much you can customise for the project at the moment. The config.json file only stores the name for the function and the container registry.
The function API is based on micro. You can check the documentation for how to read the request body, or the available APIs. There will be more extensions custom to kazi in the future, so keep an eye for that 😉.
The function can read environment variables from a .env. The values are automatically loaded when running locally (using npm run dev
), and are automatically uploaded to your Kubernetes cluster as a ConfigMap object, which is then loaded when the container starts. Therefore, you need not do any magic to get environment variable working locally or in the cluster.
Commands
$ kazi create: Scaffold a new project
$ kazi list: List the functions deployed using kazi
$ kazi deploy: Deploy a function (only works if you're inside the function's directory)
$ kazi --help: Show help text
Usage
Command: kazi create <Function_Name>
Options: kazi create
--registry (-r): Your registry namespace (REQUIRED)
--use-yarn: Use Yarn to install dependencies (default: false)
--workspace-install: Used to install the dependencies in a workspace i.e using the workspace's node_modules(default: false).
Examples
$ kazi create hello --registry=docker.io/pmbanugo
Command: kazi deploy
Options: kazi deploy
--context (-c): Specify the context to use for the deployment (OPTIONAL)
--namespace (-n): Specify the namespace to deploy into (OPTIONAL)
--kubeconfig: Specify the KUBECONFIG YAML string to use for authentication (OPTIONAL)
--server: Specify the Kubernetes API Server URL (OPTIONAL)
--token: Specify the authentication token of a service account (OPTIONAL)
--skip-tls-verify: Skip verifying TLS certificate of the API server
Examples
$ kazi deploy
$ kazi deploy -c docker-desktop
$ kazi deploy -c docker-desktop -n default
Command: kazi deploy
Options: kazi deploy
--context (-c): Specify the context to use for the deployment (OPTIONAL)
--namespace (-n): Specify the namespace to deploy into (OPTIONAL)
--kubeconfig: Specify the KUBECONFIG YAML string to use for authentication (OPTIONAL)
--server: Specify the Kubernetes API Server URL (OPTIONAL)
--token: Specify the authentication token of a service account (OPTIONAL)
--skip-tls-verify: Skip verifying TLS certificate of the API server (OPTIONAL)
Examples
$ kazi deploy
$ kazi deploy -c docker-desktop
$ kazi deploy -c docker-desktop -n default
Command: kazi list
Options: kazi deploy
--context (-c): Specify the context to use for the deployment (OPTIONAL)
--namespace (-n): Specify the namespace to deploy into (OPTIONAL)
--kubeconfig: Specify the KUBECONFIG YAML string to use for authentication (OPTIONAL)
--server: Specify the Kubernetes API Server URL (OPTIONAL)
--token: Specify the authentication token of a service account (OPTIONAL)
--skip-tls-verify: Skip verifying TLS certificate of the API server (OPTIONAL)
Examples
$ kazi list
$ kazi list -c docker-desktop
$ kazi list -n default
This repo is still a work in progress, so contributiong rules might change. But you're free to send PR, see RELEASE doc for release information and CONTRIBUTING for contributiong guideline.
FAQs
Serverless functions allow developers to quickly implement and deploy functionality that can be invoked via HTTP requests. This CLI enables easy development and deployment of serverless JS functions to Knative. Currently supports deploying only Node.js fu
The npm package @kazi-faas/cli receives a total of 0 weekly downloads. As such, @kazi-faas/cli popularity was classified as not popular.
We found that @kazi-faas/cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.