New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mollitia

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mollitia

JavaScript Resilience Library

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
2.3K
-26.56%
Maintainers
2
Weekly downloads
 
Created
Source

Mollitia


Mollitia Icon

JavaScript Resilience Library

Mollitia is a JavaScript Resilience library that works on Node and on browsers.

Its purpose is to help organize asynchronous operations under a highly customizable circuit that helps manage error use cases.

When everything is falling apart, it stops the classic flow and uses modules to manage failures.

📄 Documentation

Please check out the official documentation to get started using Mollitia, visit genesys.github.io/mollitia.

⚙️ Installation

npm install --save mollitia

🚀 Usage

// Imports the library
import * as Mollitia from 'mollitia';
// Creates a circuit
const myCircuit = new Mollitia.Circuit({
	// Initializes a circuit with a handler
	func: yourFunction
});
// This will execute yourFunction('dummy')
await myCircuit.execute('dummy');
// Imports the library
import * as Mollitia from 'mollitia';
// Creates a retry module
const myRetryModule = new Mollitia.Retry({
	attempts: 2,
	interval: 500
});
// Creates a circuit
const myCircuit = new Mollitia.Circuit({
	// Initializes a circuit with a handler
	func: yourFunction,
	options: {
		modules: [
			// Adds a retry module to the circuit
			myRetryModule
		]
	}
});
// This will execute yourFunction('dummy'), but if it fails, it will retry two times, once every 500ms
await myCircuit.execute('dummy');

Keywords

mollitia

FAQs

Package last updated on 08 Apr 2025

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