Socket
Socket
Sign inDemoInstall

@filestack/tools

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@filestack/tools

Tools used by filestack


Version published
Weekly downloads
1
Maintainers
3
Weekly downloads
 
Created
Source

Javascript tools used by filestack


Api Documentation

Api documentations is available on github pages

Tools included

  • file - file manipulation tools like exif removal, mimetypes operations etc
    • filterJpeg - filter jpeg file metadata
    • extensionToMime - convert extension to mimetype
    • getMimetype - returns mimetype based on magicbytes and extension
    • isAcceptable - checks if ext or mime is in acceptable array

How to use

NodeJS

import { filterJpeg } from 'filestack-tools';
filterJpeg(FILE_BUFFER, options);

Browsers

ES module
import { filterJpeg } from 'filestack-tools';
filterJpeg(BLOB, options);
UMD module
<script src="//static.filestackapi.com/filestack-tools/{MAJOR_VERSION}.x.x/filestack-tools.min.js" crossorigin="anonymous"></script>
<script>
  const filterJpeg = filestackTools.filterJpeg(FILE);
</script>

where {MAJOR_VERSION} is one of the MAJOR versions of the filestack-js ie:

<script src="//static.filestackapi.com/filestack-tools/3.x.x/filestack-tools.min.js" crossorigin="anonymous"></script>
<script>
  const filterJpeg = filestackTools.filterJpeg(FILE);
</script>
SRI

Subresource Integrity (SRI) is a security feature that enables browsers to verify that files they fetch (for example, from a CDN) are delivered without unexpected manipulation. It works by allowing you to provide a cryptographic hash that a fetched file must match

To obtain sri hashes for filestack-tools library check manifest.json file on CDN:

https://static.filestackapi.com/filestack-tools/{LIBRARY_VERSION}/manifest.json
<script src="//static.filestackapi.com/filestack-tools/{LIBRARY_VERSION}/filestack-tools.min.js" integrity="{FILE_HASH}" crossorigin="anonymous"></script>

Where {LIBRARY_VERSION} is currently used library version and {FILE_HASH} is one of the hashes from integrity field in manifest.json file

Rollup support

When using with rollup, set resolve plugin with option browser:true

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Contributing

We follow the conventional commits specification to ensure consistent commit messages and changelog formatting.

FAQs

Package last updated on 04 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc