{"_id":"detect-content-type","_rev":"4-f29dff551e3cbd345f2ab8c59bf98c90","name":"detect-content-type","description":"detect-content-type implements the algorithm described at http://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. It always returns a valid MIME type: if it cannot determine a mo","dist-tags":{"beta":"1.0.0","latest":"1.2.0"},"versions":{"1.0.0":{"name":"detect-content-type","version":"1.0.0","description":"detect-content-type implements the algorithm described at http://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. It always returns a valid MIME type: if it cannot determine a mo","main":"./lib/index.js","scripts":{"test":"mocha -C --require babel-register src/test.js","build":"babel src -d lib","prepublish":"npm run build","lint":"eslint .","fmt":"prettier --write --no-semi --single-quote src/**/*.js","precommit":"lint-staged"},"lint-staged":{"*.js":["prettier --write --no-semi --single-quote","eslint","git add"]},"repository":{"type":"git","url":"git+https://github.com/deepakjois/node-detect-content-type.git"},"keywords":["content-type","http"],"author":{"name":"Deepak Jois"},"license":"MIT","bugs":{"url":"https://github.com/deepakjois/node-detect-content-type/issues"},"homepage":"https://github.com/deepakjois/node-detect-content-type#readme","devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^8.2.1","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","eslint":"^4.16.0","eslint-plugin-mocha":"^4.11.0","husky":"^0.14.3","lint-staged":"^6.1.0","mocha":"^5.0.0","prettier":"^1.10.2"},"gitHead":"9b9ace17ec6d7408d1271d48899a2a5e8e65858a","_id":"detect-content-type@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"debugjois","email":"deepak.jois@gmail.com"},"dist":{"integrity":"sha512-7QYfk5MOAPe7zVy0Vs/ygU8IEqpaP6tMV4RZgp0t9laK+SFCQ6+JlDrBqL+f6BX2Vz1x1Lu10jR9HCckyCgzxw==","shasum":"f7f6a4e145007c53b6127ddd7c9d1a3f05ed72d3","tarball":"https://registry.npmjs.org/detect-content-type/-/detect-content-type-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXZyKEgmwVJpNO+HwRbrEzJb+z4MCbM+yw6E+vvUB6CwIgAnJt/XFcnvrUK/6D2mwSPuF6ZPLrgPYjVlqSUxhbH4A="}]},"maintainers":[{"name":"debugjois","email":"deepak.jois@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-content-type-1.0.0.tgz_1517507710906_0.18546197656542063"}},"1.0.1":{"name":"detect-content-type","version":"1.0.1","description":"detect-content-type implements the algorithm described at http://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. It always returns a valid MIME type: if it cannot determine a mo","main":"./lib/index.js","scripts":{"test":"mocha -C --require babel-register src/test.js","build":"babel src -d lib","prepublish":"npm run build","lint":"eslint .","fmt":"prettier --write --no-semi --single-quote src/**/*.js","precommit":"lint-staged"},"lint-staged":{"*.js":["prettier --write --no-semi --single-quote","eslint","git add"]},"repository":{"type":"git","url":"git+https://github.com/deepakjois/node-detect-content-type.git"},"keywords":["content-type","http"],"author":{"name":"Deepak Jois"},"license":"MIT","bugs":{"url":"https://github.com/deepakjois/node-detect-content-type/issues"},"homepage":"https://github.com/deepakjois/node-detect-content-type#readme","devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^8.2.1","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","eslint":"^4.16.0","eslint-plugin-mocha":"^4.11.0","husky":"^0.14.3","lint-staged":"^6.1.0","mocha":"^5.0.0","prettier":"^1.10.2"},"gitHead":"acdbc7ef540da74629ef44b6ef64017485b6348a","_id":"detect-content-type@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"debugjois","email":"deepak.jois@gmail.com"},"dist":{"integrity":"sha512-w+s39IoxT9b3SZj0OHfs2nNUDYff5msp5ag+y5vpM+IhRqX6pjyJ0rRZxIXBkmkHEL6NtLWDBTS4eCQPIhktHw==","shasum":"7c14f2d5de297364562403c9765b1b9f22011d4f","tarball":"https://registry.npmjs.org/detect-content-type/-/detect-content-type-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWmQUTDNHhaZc7Or7WHStC7Zfp7epNu/xV0GDUJkKOpwIgJu8ex3STsWK82Oany3ZDhSfaBrGHImryADnMEiK8SQ4="}]},"maintainers":[{"name":"debugjois","email":"deepak.jois@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-content-type-1.0.1.tgz_1517551285397_0.6962943966500461"}},"1.1.0":{"name":"detect-content-type","version":"1.1.0","description":"detect-content-type implements the algorithm described at http://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. It always returns a valid MIME type: if it cannot determine a mo","main":"./lib/index.js","scripts":{"test":"mocha -C --require babel-register src/test.js","build":"babel src -d lib","prepare":"npm run build","lint":"eslint .","fmt":"prettier --write --no-semi --single-quote src/**/*.js","precommit":"lint-staged"},"lint-staged":{"*.js":["prettier --write --no-semi --single-quote","eslint","git add"]},"repository":{"type":"git","url":"git+https://github.com/deepakjois/node-detect-content-type.git"},"keywords":["content-type","http"],"author":{"name":"Deepak Jois"},"license":"MIT","bugs":{"url":"https://github.com/deepakjois/node-detect-content-type/issues"},"homepage":"https://github.com/deepakjois/node-detect-content-type#readme","devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^8.2.1","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","eslint":"^4.16.0","eslint-plugin-mocha":"^4.11.0","husky":"^0.14.3","lint-staged":"^6.1.0","mocha":"^5.0.0","prettier":"^1.10.2"},"gitHead":"db92b2eef0f2771e04362320d3763e81cdbee758","_id":"detect-content-type@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"debugjois","email":"deepak.jois@gmail.com"},"dist":{"integrity":"sha512-24RYcAs0hwYuqb8F+JchFsOLjrHaS8fV+B4nlrMdNxFXIJkqmWFGZBS6q/SBYLPC1X6Jh36Oy5odI8oL2FEBCQ==","shasum":"082ab712f5da9a128b934e9725adad728ae15320","tarball":"https://registry.npmjs.org/detect-content-type/-/detect-content-type-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBeT/oCPZXv8P8QuVEIa4yh7rmKG4O+RnGTt3Dq1vJrAIhALaJaKo5DodpWfXUNxlcnnLWSSbExN4ZIThe+wo6My6E"}]},"maintainers":[{"name":"debugjois","email":"deepak.jois@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-content-type-1.1.0.tgz_1517552236813_0.2221790875773877"}},"1.2.0":{"name":"detect-content-type","version":"1.2.0","description":"detect-content-type implements the algorithm described at http://mimesniff.spec.whatwg.org/ to determine the Content-Type of the given data. It considers at most the first 512 bytes of data. It always returns a valid MIME type: if it cannot determine a mo","main":"./lib/index.js","scripts":{"test":"mocha -C --require babel-register src/test.js","build":"babel src -d lib","prepare":"npm run build","lint":"eslint .","fmt":"prettier --write --no-semi --single-quote src/**/*.js","precommit":"lint-staged"},"lint-staged":{"*.js":["prettier --write --no-semi --single-quote","eslint","git add"]},"repository":{"type":"git","url":"git+https://github.com/deepakjois/node-detect-content-type.git"},"keywords":["content-type","http"],"author":{"name":"Deepak Jois"},"license":"MIT","bugs":{"url":"https://github.com/deepakjois/node-detect-content-type/issues"},"homepage":"https://github.com/deepakjois/node-detect-content-type#readme","devDependencies":{"babel-cli":"^6.26.0","babel-eslint":"^8.2.1","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","eslint":"^4.16.0","eslint-plugin-mocha":"^4.11.0","husky":"^0.14.3","lint-staged":"^6.1.0","mocha":"^5.0.0","prettier":"^1.10.2"},"gitHead":"754fadf092a880f2a765151673189285909af763","_id":"detect-content-type@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"debugjois","email":"deepak.jois@gmail.com"},"dist":{"integrity":"sha512-YCBxuqJLY9rMxV44Ict2kNgjYFN3v1dnsn6sJvd6sUwwU1TWP3D+K2dr/S9AF/fio2/RsAKYdRiEOtNoRbmiag==","shasum":"1a8171987bf1a3558a9d25564f024fcf61dc29d3","tarball":"https://registry.npmjs.org/detect-content-type/-/detect-content-type-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWXNAzjjaKbkJ/5bAhN0c4RnZwDNRpkpaMLxEfA52a+gIhALVg0SIscPLvTcbBkPTmp4vGVw1MBQtOlOHHpRdA5/jC"}]},"maintainers":[{"name":"debugjois","email":"deepak.jois@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-content-type-1.2.0.tgz_1517561340591_0.8213268765248358"}}},"readme":"# detect-content-type\nJavascript module to determine the Content-Type of the given data, using the algorithm specified in the [MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/).\n\nThis module is useful in cases where it is not possible to determine the Content-Type of the data using filename extension, either because file does not have an extension or the filename is not available.\n\n## Installation\n\n```\nnpm install detect-content-type\n```\n\nor\n\n```\nyarn add detect-content-type\n```\n\n\n## Import\nES6 and above:\n```javascript\nimport detectContentType from 'detect-content-type'\n```\n\nUsing CommonJS:\n```javascript\nvar detectContentType = require('detect-content-type')\n```\n\n## Usage \n`detectContentType` takes a Buffer, and determines its Content-Type. It considers at most\n512 bytes of data. `detectContentType` always returns a valid MIME type. If it cannot determine a\nmore specific one, it returns `application/octet-stream`.\n \n```javascript\nlet ct = detectContentType(Buffer.from(\"<html><body></body></html>\")) // returns 'text/html; charset=utf-8'\n```\n\n## Credits\nThe code in this module is ported nearly line-by-line from the [http.DetectContentType][DetectContentType] method in the Go standard library.\n\n[DetectContentType]: https://golang.org/pkg/net/http/#DetectContentType\n","maintainers":[{"name":"debugjois","email":"deepak.jois@gmail.com"}],"time":{"modified":"2022-04-28T10:56:39.827Z","created":"2018-02-01T17:55:11.194Z","1.0.0":"2018-02-01T17:55:11.194Z","1.0.1":"2018-02-02T06:01:25.499Z","1.1.0":"2018-02-02T06:17:19.574Z","1.2.0":"2018-02-02T08:49:01.674Z"},"homepage":"https://github.com/deepakjois/node-detect-content-type#readme","keywords":["content-type","http"],"repository":{"type":"git","url":"git+https://github.com/deepakjois/node-detect-content-type.git"},"author":{"name":"Deepak Jois"},"bugs":{"url":"https://github.com/deepakjois/node-detect-content-type/issues"},"license":"MIT","readmeFilename":"README.md"}