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

koxy-js

v1.1.1

Published

Run your serverless API flows and functions in 35 regions around the world from your front-end with real-time support

Downloads

39

Readme

koxy ai

Koxy JS by Koxy AI

Koxy AI is a no-code platform helps you build your AI-powered serverless back-end served edge-close to users from 35 regions, and Koxy JS is a client library to integrate your Koxy back-end in your front-end.

NPM Static Badge Website npm npm collaborators Maintenance Status


Installation

npm install koxy-js

Usage

First go to Koxy AI platform, sign up and create your Koxy Cloudspace. You can create API flows and cloud functions in the platform and run them from your front-end as described below: (full docs)

import { koxyAPI } from 'koxy-js';

// Initialize (replace CLOUDSPACE_TOKEN with your Cloudspace token)
const api = new koxyAPI("CLOUDSPACE_TOKEN");

// Set request parameters
const parameters = {
   "param1": "value1"
};

// Run API flow (replace "main" with the flow name you want to run)
const data = await api.run("main", parameters);

// Run cloud function
const functionData = await api.runFunction("function_name");

Send Parameters and headers

You can send parameters and headers to your API flows. example:

import { koxyAPI } from 'koxy-js';

// Initialize (replace CLOUDSPACE_TOKEN with your Cloudspace token)
const api = new koxyAPI("CLOUDSPACE_TOKEN");

// Set request parameters
const parameters = {
   "param1": "value1"
};

// Set request headers
const headers = {
   "customHeader": "headerValue"
};

// Run API flow (replace "main" with the flow name you want to run)
const data = await api.run("main", parameters, headers);

Currently, You can't send parameters or headers to cloud functions.

Real-time

Real-time in Koxy AI is built on top of GunDB, It's decentralized and has no limits. After creating a Cloudspace in Koxy AI, you can go to Real-time channels from the sidebar to get your real-time ROOT_ID and manage your real-time channels. This feature is totally free with no limits at all.

import { koxyRealtime } from 'koxy-js'; 
// Setup real-time channel (You can get your root ID from your Cloudspace's tokens page)
const channel = new koxyRealtime(
   "ROOT_ID",
   "room_123"
);

// Put node to the channel and listen to it
channel.asyncPut("message_1694453447561", {
   "message": "Hello friend",
   "owner": "user_092",
   "date": 1694453447561
}, function (data) {
   console.log(data);
})

// Put node to the channel
channel.put("message_1694453447561", {
    "message": "Hello friend",
    "owner": "user_092",
    "date": 1694453447561
});

// Listen to data changes in the whole channel
channel.on("room_123", function (data) {
   console.log(data);
});

How to build your API flows

After creating your Cloudspace, go to API Flows from the sidebar, and create your first flow, just name it and you're good to go, then you can use the drag-and-drop builder to build your flow's functionality, when you're done your can save and deploy your flow to the cloud.

How to build your cloud functions (demo)

After creating your Cloudspace, go to Functions from the sidebar, and create your first function, just name it and you're good to go, now you code your cloud function, deploy it with one click and you can run it from your front-end.

Now you can run this function in the cloud from your front-end, example:

import { koxyAPI } from 'koxy-js';

// Initialize (replace CLOUDSPACE_TOKEN with your Cloudspace token)
const api = new koxyAPI("CLOUDSPACE_TOKEN");

// Run the function (replace "main_function" with your function name)
const data = await api.runFunction("main_function");

Report issues

You can support us by reporting any issues you face here

License

MIT


Built with love by Kais Radwan.