1.0.1 • Published 3 years ago

isolated-middleware v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

isolated

A Connect/Express middleware for Enabling cross-origin-isolation.

If you want to user isolated on koa app, use koa-isolated.

Cross-origin isolation enables a web page to use powerful features such as SharedArrayBuffer. This article explains how to enable cross-origin isolation on your website.

The isolation need to set the header for Cross-Origin-Opener-Policy(CROP) and Cross-Origin-Embedder-Policy(COEP).

If you want to use SharedArrayBuffer, performance.measureUserAgentSpecificMemory() or high resolution timer with better precision, you should enable cross-origin isolation.

Installation

use npm

npm install isolated-middleware

or use yarn

yarn add isolated-middleware

Quick start

Express

const express = require('express');
const isolated = require('isolated-middleware');

const app = express();
app.use(isolated());

Connect

const connect = require('connect');
const isolated = require('isolated-middleware');

const app = connect();
app.use(isolated());

License

MIT