🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

http-status-i18n

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status-i18n

HTTP status and message mapping, i18n supported.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
25
257.14%
Maintainers
1
Weekly downloads
 
Created
Source

http-status-i18n

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

HTTP status and message mapping, i18n supported.

Installation

$ npm install http-status-i18n

API

var status = require('http-status-i18n')
// or 
import status from 'http-status-i18n'

status.BROWSER_LANG

Returns a lowercase string of default browser language set by user.

status.codes

Returns an array of all the status codes as Integers.

status[code]

Map of code to status message, in the same format as the Node.js http module. undefined for invalid codes. The language has been set to default en-us.

status[404] // => 'Not Found'
status[700] // => undefined

status(code, language)

Map of code to status message with specific language. The default browser language is assumed to be en-us.

status(401, 'zh-cn') // => '无权限'
status(401, 'zh-CN') // => '无权限'
status(401, status.BROWSER_LANG) // => 'Unauthorized'
status(401) // => 'Unauthorized'

Keywords

http

FAQs

Package last updated on 05 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts