# @xdanangelxoqenpm/vel-ab-inventore

> [![NPM Version](https://img.shields.io/npm/v/@xdanangelxoqenpm/vel-ab-inventore.svg?&style=flat-square)](https://www.npmjs.org/package/@xdanangelxoqenpm/vel-ab-inventore) [![Build Status](https://api.travis-ci.org/Alex-Werner/@xdanangelxoqenpm/vel-ab-inve

Latest version **1.0.0** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xdanangelxoqenpm/vel-ab-inventore
pnpm add @xdanangelxoqenpm/vel-ab-inventore
yarn add @xdanangelxoqenpm/vel-ab-inventore
bun add @xdanangelxoqenpm/vel-ab-inventore
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-04-25 |
| First published | 2024-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xdanangelxoqE |
| Maintainers | thanhmai019901 |
| Keywords | quote, internal, equal, BigUint64Array, react-hook-form, Streams, jest, protobuf, dependencies, yup, streams, shebang, HyBi, fast-deep-clone, sham, class-validator, TypedArray, async, call-bind, bootstrap less, censor, symlinks, functions, prune, tap, installer, computed-types, xhr, negative, RFC-6455, Object.is, rapid, channel, art, concat, ie, open, chai, spinners, arktype, drop, middleware, error, reuse, ES, Int8Array, ES2020, iterate, length, authentication, bootstrap css, nope, trimLeft, protocol-buffers, argument, Stream, npm, web, emit, validator, Promise, define, metadata, tty, logging, date, gestures, airbnb, set, colors, graphql, password, fp, includes, warning, limit, parser, typesafe, styling, settings, tostringtag, ES6, guid, rmdir, patch, logger, install, prototype, core, react-testing-library, inference, fsevents, folder, dom, form-validation, ESnext, ajax, assert, spawn, concatMap, string, utils, request, persistent, interrupts, browserslist, performance, superagent, const, enumerable, eslintplugin, three, make, xdg, ECMAScript 2016, cli, CSS, setPrototypeOf, mobile, linewrap, xss, description, @@toStringTag, error-handling, symbol, lockfile, sanitization, BigInt64Array, push, waapi, contains, buffers, fast-deep-copy, eventDispatcher, group, find, findup, mime-db, up, safe, traverse, serialize, inspect, bound, style, superstruct, Map, key, hardlinks, codes, character, query, utility, mkdirs, fast-clone, forEach, app, entries, map, whatwg, reducer, typanion, handlers, slice, validation, toArray, WebSockets, syntax, RegExp.prototype.flags, es2017, getOwnPropertyDescriptor, url, curl, escape, output, intrinsic, value, accessibility, console, every, negative zero, tape, omit, weakset, executable, assertion, test, resolve, tslib, parse, tools, dataview, http, json-schema-validator, package manager, tdd, es2018, dir, fastify, JSON-Schema, deterministic, css less, es-shims, immutable, argv, iteration, less.js, autoprefixer, preprocessor, io-ts, spec, some, URL, ES7, CSSStyleDeclaration, lazy, launch, irq, xterm, writable, delete, serializer, parents, Symbol, typed, toolkit, js, iterator, path, private data, data, loading, progress, redux, validate, ECMAScript 2020, groupBy, Microsoft, command-line, formatting, setter, ponyfill, karma, express, zero, awesomesauce, ReactiveExtensions, copy, regular expressions, String.prototype.matchAll, ECMAScript 7, point-free, rangeerror, batch, native, StyleSheet, typeerror, callbind, ajv, ramda, Float64Array, events, collection.es6, from, es8, Array.prototype.findLastIndex, linux, file, walking, object, valid, getter, idle, jsdom, watchFile, Function.prototype.name, utilities, require, helpers, es-shim API, packages, ECMAScript 2017, macos, ast, framer, compiler, indicator, classes, toSorted, stylesheet, ES2016, electron, create, diff, ecmascript, framework, term, preserve-symlinks, Iterator, var, signal, ES2015, arrays, view, wrap, arguments, random, jQuery, typedarray, private, dom-testing-library, collection, Object.keys, higher-order, shrinkwrap, react, take, touch, redux-toolkit, defineProperty, eslintconfig, args, drag, which, spinner, es7, byte, config, descriptors, offset, format, es-abstract, dependency manager, getPrototypeOf, callbound, immer, default, fastclone, ES2022, worker, call, rm, plugin, variables, dataView, promises, findLast, deepclone, function, get, weakmap, look-up, ArrayBuffer, ArrayBuffer#slice, json-schema-validation, generics, colour, classname, korean, crypto, streams2, __proto__, RegExp#flags, ansi, xdg-open, ECMAScript 5, typedarrays, invariant, watching, ArrayBuffer.prototype.slice, cors, pyyaml, ender, queueMicrotask, trimStart, urls, flatMap, fastcopy, columns, jwt, pure, module, -0, react animation, flag, package, ECMAScript 2021, names, Reflect.getPrototypeOf, Array.prototype.contains, break, values, Int16Array, status, mru, findLastIndex, spring, json-schema, json, client, commander, fixed-width, regexp, coercible, remove, prop, pretty, animation, regular expression, check, cjk, ECMAScript 3, Symbol.toStringTag, trimEnd, prefix, clone, sameValueZero, link, import, characters, performant, efficient, ascii, typeof, process, look, sigint, recursive, Push, picomatch, Underscore, sigterm, positive, sequence, symbols, flags, JSON, toobject, ES3, color, cache, environment, dotenv, shim, Object.assign, popmotion, write, mocha, speed, east-asian-width, hooks, datastructure, pose, call-bound, es6, encryption, mkdir, moment, command, Observables, env, merge, optimizer, WebSocket, regular, mkdirp, exit-code, keys, exec, bdd, multi-package, sorted, watch, array, telephone, [[Prototype]], jasmine, functional, es, uuid, buffer, deepcopy, trimRight, es2016, unicode, pnpm9, zod, URLSearchParams, jsonschema, Rx, parent, deep-copy, make dir, a11y, visual, node, reduce, styleguide, extend, api, banner, ECMAScript 6, 256, harmony, ratelimit, curried, editor, browser, 3d, fullwidth, rgb, es5, postcss, internal slot, option, styles, asserts, TypeScript, mime, japanese, full-width, busy, type, scheme, equality, polyfill, chinese, nodejs, byteOffset, _.extend, ES5, ECMAScript 2022, less css, chrome, less mixins, hookform, exit, wget, Uint16Array, walk, regex, stream, website, transpiler, gradients css3, ES2023, await, trim, serialization |

## Links

- npm: https://www.npmjs.com/package/@xdanangelxoqenpm/vel-ab-inventore
- Repository: https://github.com/xdanangelxoqenpm/vel-ab-inventore
- Homepage: https://github.com/xdanangelxoqenpm/vel-ab-inventore/#readme
- Issues: https://github.com/xdanangelxoqenpm/vel-ab-inventore/issues
- npm.io page: https://npm.io/package/@xdanangelxoqenpm/vel-ab-inventore

## Dependencies (14)

- [@osjwnpm/incidunt-saepe-dicta](https://npm.io/package/@osjwnpm/incidunt-saepe-dicta.md) ^1.0.0
- [@xdanangelxoqenpm/ex-vitae-eum](https://npm.io/package/@xdanangelxoqenpm/ex-vitae-eum.md) ^1.0.0
- [@xdanangelxoqenpm/sunt-neque-ut](https://npm.io/package/@xdanangelxoqenpm/sunt-neque-ut.md) ^1.0.0
- [@xdanangelxoqenpm/unde-nam-dolores](https://npm.io/package/@xdanangelxoqenpm/unde-nam-dolores.md) ^1.0.0
- [@xdanangelxoqenpm/quo-deleniti-ipsa](https://npm.io/package/@xdanangelxoqenpm/quo-deleniti-ipsa.md) ^1.0.0
- [@xdanangelxoqenpm/iusto-beatae-error](https://npm.io/package/@xdanangelxoqenpm/iusto-beatae-error.md) ^1.0.0
- [@emiplegiaqmnpm/ad-aliquam-temporibus](https://npm.io/package/@emiplegiaqmnpm/ad-aliquam-temporibus.md) ^1.0.0
- [@xdanangelxoqenpm/ducimus-repellat-iste](https://npm.io/package/@xdanangelxoqenpm/ducimus-repellat-iste.md) ^1.0.0
- [@xdanangelxoqenpm/quia-libero-voluptate](https://npm.io/package/@xdanangelxoqenpm/quia-libero-voluptate.md) ^1.0.0
- [@xdanangelxoqenpm/aliquam-eligendi-nulla](https://npm.io/package/@xdanangelxoqenpm/aliquam-eligendi-nulla.md) ^1.0.0
- [@xdanangelxoqenpm/nostrum-sapiente-minus](https://npm.io/package/@xdanangelxoqenpm/nostrum-sapiente-minus.md) ^1.0.0
- [@xdanangelxoqenpm/assumenda-quidem-cumque](https://npm.io/package/@xdanangelxoqenpm/assumenda-quidem-cumque.md) ^1.0.0
- [@xdanangelxoqenpm/quo-tempora-praesentium](https://npm.io/package/@xdanangelxoqenpm/quo-tempora-praesentium.md) ^1.0.0
- [@xdanangelxoqenpm/perspiciatis-molestias-alias](https://npm.io/package/@xdanangelxoqenpm/perspiciatis-molestias-alias.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-04-25

## README

# FSLockJS

[![NPM Version](https://img.shields.io/npm/v/@xdanangelxoqenpm/vel-ab-inventore.svg?&style=flat-square)](https://www.npmjs.org/package/@xdanangelxoqenpm/vel-ab-inventore)
[![Build Status](https://api.travis-ci.org/Alex-Werner/@xdanangelxoqenpm/vel-ab-inventore.svg?branch=master)](https://travis-ci.com/Alex-Werner/@xdanangelxoqenpm/vel-ab-inventore)


> Easy to use file system queue with locking and events.
> Provide Asynchronous utilities for Directories and File

This library's goal is to provide nothing than a easy way to wait for the asynchronous execution of a FS operation in a lock environment.

### Table of Contents
 - [Installation](#installation)
 - [Usage](#usage)
 - [Documentation](#documentation)
    - [Events](/docs/events.md)
    - [FSLock API](/docs/FSLock.md)
    - [Directory API](/docs/Directory.md)
    - [File API](/docs/File.md)
    - [Job API](/docs/Job.md)
 - [FAQ](#faq)
 
 
## Installation 

`npm install fslock`

## Usage

```$xslt
mkdir myproject
cd myproject
npm init
npm install fslock
touch index.js
```
 
And there just use that snipets to start playing ! : 


```js
const {FSLock, File, Directory} = require('@xdanangelxoqenpm/vel-ab-inventore');
const queue = new FSLock();

const start = async function () {
  const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
  const doc2 = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:27};
  const job = queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
  const job2 = queue.add('File.overwrite','.db/507f1f77bcf86cd799439011.json',doc2);
  const job3 = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');

  await job3.execution();
  console.log(job3.results===doc2) //true
  
  const isExisting = await File.exists('.db/507f1f77bcf86cd799439011.json')//true
}
start();
```

Alternatively, you could suppress the autoexec, and deal with it this way 

```js
  const queue = new FSLock({autoexec:false});
  const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
  queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
  const job = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');

  await queue.processNext();
  await queue.processNext();
  console.log(job.results===doc) //true
```

Also, we provide events on job 

```js
  const queue = new FSLock({autoexec:false});
  const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
  queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
  const job = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');
  job.on('executed',()=>{
    console.log(job.results);
    console.log(job.results===doc) //true
  });
  queue.start();
```


## Documentation 
- [Events](/docs/events.md)
- [FSLock API](/docs/FSLock.md)
- [Directory API](/docs/Directory.md)
- [File API](/docs/File.md)

## FAQ : 

### Why ? 

Because of being able to do `await job.execution()`

Which end up being a nice way to wait for the resolvement of a FS Job in concurrent conditions

```js
const job = await this.queue.add('File.exists', path).execution(); 
const isExistingFile = job.results;
```

Alternatively equal to this below, that will only returns results when having it. 

```js
const results = await this.queue.add('File.exists', path).getResults(); 
```

### Caveat ? 

Right now, an instance of FSLock only deal locally with the locks. If needed, we can make two instance working together with using real os lock.   
Submit issue if you need such features.

---
_Source: https://npm.io/package/@xdanangelxoqenpm/vel-ab-inventore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
