Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tknf/node-header-helpers

A generic, framework-independent string helper for headers.
https://github.com/tknf/node-header-helpers

Last synced: 8 days ago
JSON representation

A generic, framework-independent string helper for headers.

Awesome Lists containing this project

README

        

# @tknf/node-header-helpers
## Get Started

### Install
```bash
yarn add @tknf/node-header-helpers
# or
npm install --save @tknf/node-header-helpers
```

### Use on express
```js
import express from "express";
import { getContentTypeHeader, TextHtml } from "@tknf/node-header-helpers";

const app = express();

app.get("/", async (req, res) => {
res.set(getContentTypeHeader(), TextHtml());
return res.status(200).send(`Hello world!`);
});
```