
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Seamlessly use [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to offload work that could block user interaction and page rendering.
Seamlessly use Web Workers to offload work that could block user interaction and page rendering.
With Fibrelite you can turn any async function into a Web Worker. Fibrelite has three core strategies to executing work:
Check out Fibrelite in action here. This is a hosted version of the index.html and example.js inside this repository.
For npm:
npm install fibrelite
Or for yarn:
yarn add fibrelite
Alternatively you can use the unpkg CDN like so:
<script src="https://unpkg.com/fibrelite@2.0.0/dist/fibrelite.js"></script>
Fibrelite takes three arguments, the second two are optional:
const worker = new fibrelite(asyncHello, numberOfWorkersInPool, debounceInMilliseconds);
Changing numberOfWorkersInPool will make use of a pool of workers in for running you async function (defaults to 1). If you want to change the debounce period for worker.debounce you can set debounceInMilliseconds (defaults to 333 milliseconds).
You can use Fibrelite like this:
(async() => {
const asyncHello = async (input) => {
return "Hello " + input;
};
const worker = new fibrelite(asyncHello);
const response = await worker.execute("World!");
// const response = await worker.debounce("World!");
// const response = await worker.prioritise("World!");
console.log(response); // logs 'Hello World!'
})(); // await calls must be wrapped in an async function
To build Fibrelite you can run:
npm run build
To watch for file changes and build:
npm run watch
To run tests you can do:
npm run test
For convenience you can run the example using live-server using:
npm run serve
A massive thanks to Jason Miller for the Greenlet library on which this is heavily based and inspired.
MIT
FAQs
Seamlessly use [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to offload work that could block user interaction and page rendering.
The npm package fibrelite receives a total of 12 weekly downloads. As such, fibrelite popularity was classified as not popular.
We found that fibrelite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.