open-index/open-npm huggingface dataset:
npm package: @leanylabs/formula-engine
Description: Extendable formula parser and executor.
Author: LeanyLabs
Latest version: 1.1.0

# Formula Engine

Extendable formula parser and executor.

## Usage

[Demo](https://codesandbox.io/s/formula-engine-demo-vxqkc?file=/src/App.tsx)

Typical expression may look like this:

```
'the answer is: ' + TO_STRING(POW(2, {var}) + 10)
```

The computed result, given `var = 5` would be a string: `'the answer is: 42'`.

Where `TO_STRING` and `POW` are functions that you provide implementation for.
Also `{var}` is a variable, you should also provide a value resolver for those.

```ts
function resolveReferences(names: string[]): Record<string, any> {
  // your implementation to resolve variables
  return {
    a: 10,
    b: 20,
  };
}

const functions = {
  // your custom functions
  TO_STRING(val) {
    return String(val);
  },
  POW(x, a) {
    return Math.pow(x, a);
  },
};

const engine = new FormulaEngine(resolveReferences, functions);
```

Note: all functions should be provided by the user, nothing is included by default. It is mostly to avoid conflicts and make the library reusable.

## Data types

It supports three types of literals (data types):

- boolean
- number
- string (both single&double quoted)

Currently type checking is not implemented, so the engine is relying on JS type coercion.
Be careful with it, the result may be not always obvious (if you subtract string from a number for example).

## Development

This is very much work in progress, but is is working for the main use cases, so we believe it can be useful already.
npm package: @leanylabs/logger
Description: LeanyLabs Logger
Author: LeanyLabs
Latest version: 1.2.0

## Usage

You have two ways to use the lib:

1.  With default env variables name (which are: LOGGING_LEVEL, SERVICE_NAME and isProd which depends on NODE_ENV either including partial string 'prod' or not), the values of the variables must be defined in your process enviroment

```js
const { logger } = require("@leanylabs/logger");

logger.info("hello world");
```

2.  Pass the needed variables manually into initially imported function 'createLogger' and then by means of in create the logger itself

```js
const { createLogger } = require("@leanylabs/logger");

const logger = createLogger({
  isProduction: false,
  level: "silly",
  labels: {
    serviceName: "test",
  },
});
```
npm package: @leanylabs/ts-style-config
Description: LeanyLabs TypeScript Style for monday.com integrations
Author: LeanyLabs
Latest version: 0.4.0

### Usage

Install as dev dependency
- yarn: `yarn add @leanylabs/ts-style-config -D`
- npm: `npm install @leanylabs/ts-style-config -D`

Run once after install (or after updating version)
`npx @leanylabs/ts-style-config`

### Commands
The app will add few commands:
- `lint` - run linter
- `lint:fix` - run linter with fix
- `format` - run prettier