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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bfast-function

v3.0.0

Published

A serverless function engine for Node.js, built on top of Express.js and Socket.IO.

Downloads

42

Readme

BFast Function

npm version Build Status License: MIT Code Quality

BFast Function Banner

A serverless function engine for Node.js, built on top of Express.js and Socket.IO.

BFast Function provides a powerful and flexible way to build and deploy serverless functions. It's designed to be easy to use, with a simple and intuitive API.

Features

  • Easy to use: A simple and intuitive API for creating and deploying serverless functions.
  • Flexible: Supports both HTTP and Socket.IO functions.
  • Scalable: Built on top of Express.js and Socket.IO, which are known for their scalability.
  • Extensible: Can be easily extended with custom middleware and plugins.
  • Open-source: BFast Function is open-source and available on GitHub.

Getting Started

There are several ways to get started with BFast Function:

1. From npm:

The easiest way to get started is to install BFast Function from npm:

npm install bfast-function

2. From Git:

You can also clone the BFast Function repository from GitHub:

git clone https://github.com/bfast-cloud/bfast-function.git

Then, install the dependencies:

cd bfast-function
npm install

3. From a tarball:

You can also download a tarball of the BFast Function repository from the releases page.

Then, extract the tarball and install the dependencies:

tar -xvf bfast-function-*.tar.gz
cd bfast-function-*
npm install

Usage

  1. Create a functions folder:

    mkdir functions
  2. Create a function file (e.g., example.js):

    const bfast = require('bfast');
    
    exports.myHttpFunction = bfast.functions().onHttpRequest('/hello', (request, response) => {
        response.status(200).send('Hello, World!');
    });
    
    exports.mySocketFunction = bfast.functions().onSocketIO('echo', (request, response) => {
        response.emit('echo', request.body);
    });
  3. Start the BFast Function engine:

    Create an index.mjs file in your root workspace and start the Faas server:

    import {start} from 'bfast-function';
    
    start({
        port: '3000',
        functionsConfig: {
            functionsDirPath: './functions',
        }
    }).catch(console.log);

    Then, start the server:

    node index.mjs

Docker

You can also run the BFast Function engine in a Docker container.

1. Build the Docker image:

docker build -t bfast-function .

2. Run the Docker container:

docker run -p 3000:3000 bfast-function

This will start the BFast Function engine and expose it on port 3000.

You can also mount a local functions folder to the container:

docker run -p 3000:3000 -v $(pwd)/functions:/app/functions bfast-function

This will mount the functions folder in your current working directory to the /app/functions folder in the container.

Configuration

The bfast.json file is a JSON file that contains configurations for the BFast Function engine.

{
  "ignore": ["**/node_modules/**"]
}

| Key | Type | Description | | -------- | ------- | ----------------------------------------- | | ignore | Array | An array of glob patterns to ignore when loading functions. |

API Reference

For a full list of available options and APIs, please see the API Reference.

Contributing

We welcome contributions to BFast Function! If you have an idea for a new feature or have found a bug, please open an issue on our GitHub repository.

License

BFast Function is licensed under the MIT License.