Gathering detailed insights and metrics for inspector-filechecker
Gathering detailed insights and metrics for inspector-filechecker
Gathering detailed insights and metrics for inspector-filechecker
Gathering detailed insights and metrics for inspector-filechecker
npm install inspector-filechecker
Typescript
Module System
Node Version
NPM Version
70.3
Supply Chain
98.8
Quality
76.7
Maintenance
100
Vulnerability
99.6
License
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-21.4%
11
Compared to previous month
Last Year
0%
197
Compared to previous year
4
file-format-checker
is a lightweight and simple library that allows you to validate file formats based on their extension and MIME type. It also integrates with TypeScript and Jest for unit testing, making it easy to ensure the correctness of file format validation in your projects.
Supported File Formats and MIME Types This library supports a wide range of common file formats and their associated MIME types. Here's a breakdown of the supported formats:
[ jpg, jpeg, png, gif, bmp, tiff, svg, webp, ico, heic, heif, raw, psd, ai, eps ]
image/jpeg
image/png
image/gif
image/bmp
image/tiff
image/svg+xml
image/webp
image/x-icon
image/heic
image/heif
image/x-raw
image/vnd.adobe.photoshop
application/postscript
application/illustrator
[ pdf, doc, docx, ppt, pptx, xls, xlsx, csv, txt, rtf ]
application/pdf
application/msword
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/vnd.ms-powerpoint
application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.ms-excel
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
text/csv
text/plain
application/rtf
[ zip, rar, 7z, tar, gz ]
application/zip
application/x-rar-compressed
application/x-7z-compressed
application/x-tar
application/gzip
To install the file-format-checker
library, simply run the following command:
1npm install file-format-checker
For TypeScript and testing support, make sure you also install the necessary development dependencies:
1npm install --save-dev jest ts-jest @types/jest typescript
After installing the library, you can use it to validate file extensions and MIME types in your project.
1import { checkExtension } from 'file-format-checker'; 2 3console.log(checkExtension('image.jpg')); // true 4console.log(checkExtension('file.exe')); // false
1import { checkMimeType } from 'file-format-checker'; 2 3console.log(checkMimeType('image/jpeg')); // true 4console.log(checkMimeType('application/x-msdownload')); // false
Here are some keywords that are useful for categorizing your library when publishing on NPM:
file-format
file-extension
mime-type
file-validation
typescript
jest
file-checker
file-upload
This library is licensed under the MIT License. You can freely use, modify, and distribute the code as long as you adhere to the terms of the license.
With this README in place, you're ready to publish your library to NPM. You can always extend the README to provide more examples or document additional features as your library grows.
To publish your package, run the following commands:
No vulnerabilities found.
No security vulnerabilities found.