typeof-article

WebJar for typeof-article

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

typeof-article
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

typeof-article
WebJar for typeof-article
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jonschlinkert/typeof-article

Download typeof-article

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/typeof-article/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>typeof-article</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/typeof-article/
implementation 'org.webjars.npm:typeof-article:0.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/typeof-article/
implementation ("org.webjars.npm:typeof-article:0.1.1")
'org.webjars.npm:typeof-article:jar:0.1.1'
<dependency org="org.webjars.npm" name="typeof-article" rev="0.1.1">
  <artifact name="typeof-article" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='typeof-article', version='0.1.1')
)
libraryDependencies += "org.webjars.npm" % "typeof-article" % "0.1.1"
[org.webjars.npm/typeof-article "0.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : kind-of jar [3.1.0,4)

Project Modules

There are no modules declared in this project.

typeof-article NPM version NPM monthly downloads NPM total downloads Linux Build Status

Get the native JavaScript type of a value, preceded by the appropriate indefinite article (either a or an), for use in error messages.

Install

Install with npm:

$ npm install --save typeof-article

Usage

(A few of the types have some extra formatting where it makes sense. For example, instead of a regexp, it returns a regular expression, which IMHO is more readable to users. You can customize mappings if you want)

var type = require('typeof-article');

console.log(type({}));
//=> 'an object'

console.log(type([]));
//=> 'an array'

console.log(type(9));
//=> 'a number'

console.log(type(/abc/));
//=> 'a regular expression'

console.log(type(new WeakMap()));
//=> 'a WeakMap'

Get the object of types-to-articles mappings:

var types = require('typeof-article').types;

Also exposes a typeOf property, for getting the native type only:

var type = require('typeof-article');
type.types.weapmap = 'a WeakMap()';

console.log(type.typeOf(new WeakMap()));
//=> 'weakmap'

Customize

Customize any of the mappings:

var type = require('typeof-article');
type.types.weapmap = 'a WeakMap()';

console.log(type(new WeakMap()));
//=> 'a WeakMap()'

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. MIT


This file was generated by verb-generate-readme, v0.4.2, on January 30, 2017.

Versions

Version
0.1.1