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

avrasya

v1.0.28

Published

Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.

Downloads

186

Readme

Avrasya Web Framework

NPM Version NPM Install Size NPM Downloads Known Vulnerabilities Bugs Security Rating Maintainability Rating Code Smells Lines of Code Reliability Rating Duplicated Lines (%) CodeFactor Codacy Badge Coverage

Features

  • Simple and user-friendly API
  • Fast and efficient
  • Middleware support
  • Extensibility
  • Open-source and free

Getting Started

To get started with Avrasya, follow these steps:

  1. Add Avrasya to your project:
npm install avrasya
  1. Create your web server:
import Avrasya from "avrasya";

const avrasya = new Avrasya();

avrasya.router.get("/", (context) => {
    context.send("Hello World");
});

avrasya.use((context, next) => {
    console.log("middleware1");
    console.log(context.req.url + " " + context.req.method);
    next();
})

avrasya.use((context, next) => {
    console.log("middleware2");
    next();
})

avrasya.use((context, next) => {
    console.log("middleware3");
    next();
})

avrasya.listen(3000);

 File Based Routing

| src
    | index.ts
    | routes
        | get.ts
        | user
            | get.ts
            | [id]
                | get.ts
                | post.ts

get.ts Example Handler

import Context from "avrasya/src/context";
const get = (context: Context) => {
    context.send("Hello World");
}

export default get

See Example for more details.

Installation

To get started with Avrasya, follow these simple installation steps:

  1. Clone the Repository:
git clone https://github.com/muhtalipdede/avrasya.git
  1. Navigate to the Project Directory:
cd avrasya
  1. Install Dependencies:
npm install
  1. Start the Application:
npm run start

Content Type Support

Serving CSS

avrasya.router.get("/css", (context) => {
    const css = `
        body {
            background-color: red;
        }
    `;
    context.css(css);
});

Serving Javascript

avrasya.router.get("/js", (context) => {
    const js = `
        console.log("Hello World");
    `;
    context.js(js);
});

Serving HTML

avrasya.router.get("/html", (context) => {
    const html = `
        <h1>Hello World</h1>
        <p>Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.</p>
        <button>Click me</button>
    `;
    context.html(html);
});

Serving JSON

avrasya.router.get("/json", (context) => {
    const json = {
        name: "Avrasya",
        version: "1.0.13",
        description: "Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility."
    };
    context.json(json);
});

Serving Plain Text

avrasya.router.get("/text", (context) => {
    const text = "Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.";
    context.text(text);
});

Serving Files

avrasya.router.get("/image", (context) => {
    const path = "avrasya.png";
    context.file(path);
});

Redirecting

avrasya.router.get("/redirect", (context) => {
    context.redirect("https://www.google.com");
});

Contribution Guidelines

Thank you for considering contributing to this project! CONTRIBUTING

Contributors

Check out the list of contributors in the CONTRIBUTORS file.

Issue Template

If you want to report an issue or request a new feature, please use the following template. ISSUE_TEMPLATE

License

This project is licensed under the MIT License. For more information, please refer to the LICENSE File.