<commit_before># snap-mutex

A promise based mutex micro-library for JavaScript. API is optimized for async functions.

[![Build Status](https://travis-ci.org/ilkkao/snap-mutex.svg?branch=master)](https://travis-ci.org/ilkkao/snap-mutex)

[![Coverage Status](https://coveralls.io/repos/github/ilkkao/snap-mutex/badge.svg?branch=master)](https://coveralls.io/github/ilkkao/snap-mutex?branch=master)

## Installation

  $ npm install --save snap-mutex

## Example

```javascript
const mutex = require('snap-mutex');

const myMutex = new Mutex();

async function onlyOneAtTime() {
  let lock;

  try {<commit_msg>Put badges to the same line<commit_after># snap-mutex

A promise based mutex micro-library for JavaScript. API is optimized for async functions.

[![Build Status](https://travis-ci.org/ilkkao/snap-mutex.svg?branch=master)](https://travis-ci.org/ilkkao/snap-mutex) [![Coverage Status](https://coveralls.io/repos/github/ilkkao/snap-mutex/badge.svg?branch=master)](https://coveralls.io/github/ilkkao/snap-mutex?branch=master)

## Installation

  $ npm install --save snap-mutex

## Example

```javascript
const mutex = require('snap-mutex');

const myMutex = new Mutex();

async function onlyOneAtTime() {
  let lock;

  try {
{'fraction_non_alphanumeric': 0.154095701540957, 'fraction_numerical': 0.0, 'mean_word_length': 4.961352657004831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030971', 'n_tokens_mistral': 429, 'n_tokens_neox': 416, 'n_words': 83}