Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mortice

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mortice - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

dist/src/browser.d.ts

166

package.json
{
"name": "mortice",
"version": "2.0.1",
"version": "3.0.0",
"description": "Isomorphic read/write lock that works in single processes, node clusters and web workers",
"main": "lib/index.js",
"scripts": {
"test": "ava",
"lint": "standard"
},
"keywords": [
"read-write",
"cluster",
"mutex",
"lock",
"await",
"async"
],
"author": "Alex Potsides <alex@achingbrain.net>",
"license": "ISC",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/achingbrain/mortice#readme",
"repository": {

@@ -27,26 +15,142 @@ "type": "git",

},
"homepage": "https://github.com/achingbrain/mortice",
"devDependencies": {
"ava": "^3.15.0",
"browserify": "^17.0.0",
"delay": "^5.0.0",
"execa": "^5.0.0",
"run-headless": "^2.0.1",
"standard": "^16.0.3",
"webworkify": "^1.5.0"
"keywords": [
"async",
"await",
"cluster",
"lock",
"mutex",
"read-write"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"ava": {
"files": [
"test/*.test.js"
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist/src",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"import": "./dist/src/index.js"
}
},
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"sourceType": "module"
}
},
"release": {
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "chore",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"scope": "no-release",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"section": "Trivial Changes"
},
{
"type": "docs",
"section": "Trivial Changes"
},
{
"type": "test",
"section": "Tests"
}
]
}
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
},
"scripts": {
"lint": "aegir lint",
"pretest": "npm run build",
"test": "aegir test",
"test:node": "npm run test -- -f dist/test/node.js -t node --cov",
"test:chrome": "npm run test -- -f dist/test/browser.js -t browser --cov",
"test:firefox": "npm run test -- -f dist/test/browser.js -t browser -- --browser firefox",
"test:electron-main": "npm run test -- -f dist/test/node.js -t electron-main",
"build": "tsc && node esbuild.js",
"release": "semantic-release"
},
"dependencies": {
"nanoid": "^3.1.20",
"observable-webworkers": "^1.0.0",
"p-queue": "^6.0.0",
"promise-timeout": "^1.3.0"
"observable-webworkers": "^2.0.1",
"p-queue": "^7.2.0",
"p-timeout": "^5.0.2"
},
"devDependencies": {
"aegir": "^36.1.3",
"delay": "^5.0.0",
"esbuild": "^0.14.21",
"execa": "^6.0.0"
},
"browser": {
"cluster": false
"cluster": false,
"./dist/src/node.js": "./dist/src/browser.js",
"./src/node.js": "./src/browser.js"
}
}

28

README.md
# mortice
[![Build status](https://travis-ci.org/achingbrain/mortice.svg?branch=master)](https://travis-ci.org/achingbrain/mortice)
[![Build Status](https://github.com/achingbrain/mortice/actions/workflows/js-test-and-release.yml/badge.svg?branch=main)](https://github.com/achingbrain/mortice/actions/workflows/js-test-and-release.yml)
Isomorphic read/write lock that works in single processes, node clusters and web workers.
> Isomorphic read/write lock that works in single processes, node clusters and web workers.

@@ -24,4 +24,4 @@ ## Features

```javascript
const mortice = require('mortice')
const delay = require('delay')
import mortice from 'mortice'
import delay from 'delay'

@@ -98,4 +98,4 @@ // the lock name & options objects are both optional

// main.js
const mortice = require('mortice')
const observe = require('observable-webworkers')
import mortice from 'mortice'
import observe from 'observable-webworkers'

@@ -112,4 +112,4 @@ // create our lock on the main thread, it will be held here

// worker.js
const mortice = require('mortice')
const delay = require('delay')
import mortice from 'mortice'
import delay from 'delay'

@@ -126,13 +126,1 @@ const mutex = mortice()

```
Alternatively you can use the bundled `mortice.Worker` to create web workers and save yourself an extra dependency.
```javascript
const mortice = require('mortice')
const Worker = mortice.Worker
// create our lock on the main thread, it will be held here
const mutex = mortice()
const worker = new Worker('worker.js')
```
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