Simple common constants, for Javascript and Typescript projects.
- Country codes (fr,es,...)
- Extensions (wav,doc,3gp,...)
- Http codes (404,499,...)
- Http methods (GET,POST,...)
- Language codes (fr,ty,...)
npm install generalities --save
or
yarn add generalities
import { UNITED_KINGDOM } from 'generalities/country-codes';
// print: gb
console.log(UNITED_KINGDOM);
Print extensions without dot .
import { VIDEO_3GPP2 } from 'generalities/extensions';
// print: 3g2
console.log(VIDEO_3GPP2);
import { GET } from 'generalities/http-methods';
// print: GET
console.log(GET);
import { HTTP_CODE_NOT_FOUND } from 'generalities/http-codes';
// print: 404
console.log(HTTP_CODE_NOT_FOUND);
import { FRENCH, TAHITIAN } from 'generalities/language-codes';
// print: fr,ty
console.log(FRENCH, TAHITIAN);
import { VIDEO_3GPP2 } from 'generalities/mime-types';
// print: video/3gpp2
console.log(VIDEO_3GPP2);
npm install
Add your generalities
and then run npm run compile
Linting
npm run lint
Please feel free to submit, comment anything on this repo :)
- Currency codes