0.0.5 • Published 1 year ago

osik v0.0.5

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

osik

osik is a nodejs backend framework centered on performance and weight.

Inspired by koa, only middleware is supported by default, but the handler of this framework is inspired by express, not koa. The concept of middleware is similar to express.


const { osik } = require('osik');

const app = osik();

app.use((req, res, next) => {
  res.body = 'Hello World!';
});

app.listen(3000);

Features

  • ⚡ Fast
  • 📦 Light
  • 🚀 Async/Await
  • ⚒️ Middleware

Installation

Install using npm:

npm install osik

async/await

osik supports async/await by default.

app.use(async (req, res, next) => {
  await next();
  console.log('2');
});

app.use(async (req, res) => {
  await new Promise((resolve) => {
    setTimeout(() => {
      resolve();
    }, 1000);
  });

  console.log('1');

  res.body = 'Hello World!';
});

result:

$ node index.js
1
2

License

MIT

0.0.3

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago