# network-constants

> a bunch of network (mainly HTTP) constants for js programs (node + browser), AMD

Latest version **0.12.0-alpha** (published 2014-02-12) · public domain license · 0 weekly downloads

## Install

```sh
npm install network-constants
pnpm add network-constants
yarn add network-constants
bun add network-constants
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.12.0-alpha |
| Published | 2014-02-12 |
| First published | 2013-11-26 |
| Weekly downloads | 0 |
| License | public domain |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Offirmo |
| Maintainers | offirmo |
| Keywords | network, constants, http, protocol, browser, server |

## Links

- npm: https://www.npmjs.com/package/network-constants
- Repository: https://github.com/Offirmo/network-constants.js
- Issues: https://github.com/Offirmo/network-constants.js/issues
- npm.io page: https://npm.io/package/network-constants

## Dependencies (1)

- [amdefine](https://npm.io/package/amdefine.md) ~0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.12.0-alpha (latest) — 2014-02-12
- 0.11.0 — 2014-02-04
- 0.10.0 — 2014-02-04
- 0.9.2 — 2014-02-03
- 0.9.0 — 2013-11-26

## README

network-constants.js
====================

[![Build Status](https://travis-ci.org/Offirmo/network-constants.js.png?branch=master)](https://travis-ci.org/Offirmo/network-constants.js)
[![NPM version](https://badge.fury.io/js/network-constants.png)](http://badge.fury.io/js/network-constants)
[![Bower version](https://badge.fury.io/bo/network-constants.js.png)](http://badge.fury.io/bo/network-constants.js)
[![Dependency Status](https://gemnasium.com/Offirmo/network-constants.js.png)](https://gemnasium.com/Offirmo/network-constants.js)
[![Project status](http://img.shields.io/badge/project_status-stable_and_active-brightgreen.svg)](http://offirmo.net/classifying-open-source-projects-status/)
[![license](http://img.shields.io/badge/license-public_domain-brightgreen.svg)](http://unlicense.org/)
[![Code Climate](https://codeclimate.com/github/Offirmo/network-constants.js.png)](https://codeclimate.com/github/Offirmo/network-constants.js)
[![status](https://sourcegraph.com/api/repos/github.com/Offirmo/network-constants.js/badges/status.png)](https://sourcegraph.com/github.com/Offirmo/network-constants.js)
[![Total views](https://sourcegraph.com/api/repos/github.com/Offirmo/network-constants.js/counters/views.png)](https://sourcegraph.com/github.com/Offirmo/network-constants.js)
[![Gittip](http://img.shields.io/gittip/Offirmo.svg)](https://www.gittip.com/Offirmo/)

Introduction
------------

A clean declaration of network constants (only HTTP for now) for js programs.

Useful when developing network programs or if you want to use HTTP semantics (REST API).

Works in node.js + browser, AMD.

Full testsuite. No dependencies.

License : public domain (http://unlicense.org/)

Fell free to suggest and contribute.

Interesting reads :
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
http://www.codeshttp.com/  (us / french)
http://benramsey.com/blog/2009/02/http-status-100-continue-corrections/
http://benramsey.com/blog/2008/04/http-status-201-created-vs-202-accepted/
http://benramsey.com/blog/2008/05/http-status-204-no-content-and-205-reset-content/
http://benramsey.com/blog/2008/05/206-partial-content-and-range-requests/
http://benramsey.com/blog/2009/11/post-vs-put/

Usage
-----

```javascript
if (typeof define !== 'function') { var define = require('amdefine')(module); } // node only

define(
[
	'network-constants/http'
],
function(http_constants) {
	"use strict";

	console.log( http_constants.methods.get ); // "GET"
	console.log( http_constants.status_codes.status_400_client_error_bad_request ); // 400
	console.log( http_constants.status_messages[404] ); // "Not Found"
	...
```

Installation
------------

Bower : `bower install network-constants.js`
Npm : `npm install network-constants`

Unit tests
----------

Browser : open test_runner/mocha.html
Node : `npm test`

---
_Source: https://npm.io/package/network-constants · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
