Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

ahdinosaur/is-json-media-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-json-media-type

is this a JSON-based media type (rfc6838)?

useful when checking whether or not to JSON.parse for a given Content-Type header.

tested with iana/media-types, (updated: October 2015)

install

with npm, run

npm install --save is-json-media-type

usage

var isJsonMediaType = require('is-json-media-type')

isJsonMediaType('text/plain') // false
isJsonMediaType('application/json') // true
isJsonMediaType('application/ld+json') // true

About

is this a JSON-based media type (rfc6838)?

Resources

Stars

Watchers

Forks

Packages

No packages published