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

blazze

v1.4.0

Published

The express framework for the web. Write Typesafe API's with no configuration and boiler-plate with dynamic directory based routing and intuitive CLI.

Downloads

74

Readme

Screenshot 2024-01-21 153036-modified

Static Badge Static Badge Static Badge Static Badge Static Badge X (formerly Twitter) URL Static Badge GitHub commit activity (branch)

Write APIs in TypeScript with zero configuration, no boilerplate, request caching, and blazingly fast. Blazze.js is a powerful and lightweight JavaScript framework designed to simplify web development. With a focus on simplicity and performance, Blazze.js provides a set of features that make building web applications a breeze.

Features

  • 😎 Request Caching: - Blazze handles caching automatically in both Production and Dev Environments. In production it is obviously necessary to optimize large computations however, request caching is taken care of in dev mode as well by Blazze to provide a smooth developer experience, there is no need to revalidate the cache manually Blazze handles everything under the hood.

  • 🏎️ Powered by SWC: - Blazze leverages Rust-based tool: Speedy Web Compiler to transpile Typescript files, so there is negligible waiting time after file changes.

  • 🐣 Easy Setup: - Hit npx blazz-init to start building your projects, you'll be asked a few questions for configuring Blazze & that's it Blazze will set up the project for you.

  • 💪 TypeScript: - Out-of-the-box TS support, no configurations, and environment setup, just get started directly.

  • 📂 Directory based Routing: - Keep the logic separated without any setup. Routes are based on the directory structure. ex: you will create a dir user inside of which you can add your logic for various request methods viz: GET, POST, PUT, PATCH, DELETE.

  • 🚀 Fast & Robust: - Built on top of Express JS and Helmet JS, security and efficiency by default.

  • 💫 No Boiler Plate Code: - Install init and start, Nothing else 🚀

  • 🔥 Build Optimization: - Makes a single optimized Expressjs bundle for your complete app

How to start?

  • Install blazze

      npm i blazze@latest
  • Run the below command in the terminal.

      npx blazze-init
  • You will be asked a few questions to configure blazze.config.js

      PS C:\Users\yaksh\bltest> npx blazze-init      
      ? What is your project named? myFuckingAPIS
      ? What will be the root endpoint for your project? api/v5.1/users/i
      ? Would you like to use TypeScript? yes
      ? Which port should the server listen to? 3000
      ? Where would you like to keep your static content like HTML and PNG files? public
      ? Would you like to enable request caching? (Experimental) yes
      ✔  Configuring your Blazze App
      Run commands:
      
            - npm i
            - npm run dev
      
      Success ! Created myFuckingAPIS at C:\Users\yaksh\bltest
      You are ready to Blazze 🚀. Refer to docs at https://github.com/Axnjr/Blazze.js/main/README.md.
  • Create your API routes in the root-endpoint directory

  • Each route can have 5 HTTP method files viz: GET, POST, PUT, PATCH, DELETE

  • Project Structure

      myFuckingAPIS
      ├── api/v5.1/users/i (root-endpoint)
      │ ├── Route-1
      │ │ ├── GET.ts
      │ │ ├── POST.ts
      │ │ ├── PUT.ts
      │ │ ├── DELETE.ts
      │ │ ├── PATCH.ts
      │ └── Other-routes / ...
      ├── blazze (for typescript)
      ├── cache (if enabled)
      ├── public (static-root)
      ├── blaze.config.js (from blazze-init)
      ├── package.json
      ├── packagelock.json
      └── ...
  • Each file handles specific API request methods

  • You need to export a default normal function from each file

  • These functions get Express Request and Response objects as parameters

  • For nested routes use the "@" symbol ex: new/subs/ppl will be -> new@subs@ppl which will have its respective logic

  • This is to avoid deep recursive file watching and being more performant for the system

  • Dynamic routes start with an underscore "_" ex: api/v1/_users

  • That's it you are ready to Blazze 🚀, below is an example of get request for dynamic route user.

    // api/v1/_user/GET.ts
      
    import { Request, Response } from "express"
    
    export default async function (req:Request, res:Response){
        let data, r = req.query.q
        try {
            data = await fetch(`https://freeaiapi.vercel.app/api/Sentiments?query='${r}'`)
        } catch (error) {
            data = error
        }
      
        let t = await data.json()
      
        res.json({
            Data:t,
            Query:r
        });
    }

Upcoming Features

  • GraphQl integration
  • Elegant Middlewares
  • Rust binding for faster performance
  • Templating Engine
  • Web Sockets & Webhooks
  • Polling

Contribute to Blazze

Read the Contribution guidlines to begin.

Give Blazze a Star ❤️⭐