open-index/open-npm huggingface dataset:
npm package: @lite-v3/locky
Description: Handy engine version validator
Latest version: 1.0.1

# @lite-v3/locky

A handy engine version validator. Tiny and has no dependencies.

![By Tokopedia](https://img.shields.io/badge/WPE-Tokopedia-brightgreen.svg?style=flat-square)[![Version][npm-badge]][npm]

## Install

```sh
pnpm install @lite-v3/locky --dev
```

## Usage
### CLI
`@lite-v3/locky` is suitable to apply at preinstall script. Safely runs your installation script by validating your engine version requirements.

```json
// <root>/package.json
{
    ...
    "scripts" : {
       "preinstall": "npx @lite-v3/locky --quite"
    },
    ...
    "engines": {
        "node": ">=14.17 <15",
        "pnpm": ">=4"
    }
}
```

Behind the scene, locky will compare your installed node and pnpm version with the specified version in root package.json. If the requirement is not satisfied, rather than logging with warnings, locky will throw the error. The purpose is we make a pre-validation process to isolate the depenencies of your specific version.

The script also ensure you are correctly using `pnpm` rather than other package managers.

### API
```js
    const checkEngine = require('@lite-v3/locky');

    try {
        checkEngine();
        // requirement is satisfied
    } catch {
        // requirement is not satisfied
    }
```

---

Code By WPE Team @Tokopedia

[npm]: https://www.npmjs.org/package/@lite-v3/locky
[npm-badge]: https://img.shields.io/npm/v/@lite-v3/locky.svg?style=flat-square