open-index/open-npm huggingface dataset:
npm package: @itsmrmonday/jsipc
Description: IPC bindings for PyIPC, a electron IPC replacement written in Python
Author: Cyber M Inc
Latest version: 1.1.6

# JsIPC

This project is solely used because I hate using js for IPC controls

This is to be used with the following pyton3 server:

[PyIPC](https://github.com/its-mr-monday/pyipc)

## Installation

Using npm:
```console
    npm i @itsmrmonday/jsipc
```

Using yarn:
```console
    yarn add @itsmrmonday/jsipc
```

# JsIPC Documentation

JsIPC is a JavaScript class for inter-process communication using Socket.IO. It provides an easy-to-use interface for connecting to a server, handling events, and invoking remote procedures.

## Import

```javascript
//For ES6 (React, Angular, etc)
import JsIPC from '@itsmrmonday/jsipc';

//For ES5 (Node, Electron, etc)
const JsIPC = require('@itsmrmonday/jsipc');
```

## Class: JsIPC

### Constructor

```javascript
new JsIPC(port = 5000, logger = false)
```

Creates a new JsIPC instance.

- `port`: The port number to connect to (default is 5000)

### Methods

#### on(event, handler)

Registers a handler for a specific event.

```javascript
ipc.on('greet', (data) => {
    return `Hello, ${data.name}!`;
});
```

#### off(event)

Removes a handler for a specific event.

```javascript
ipc.off('greet');
```

#### async invoke(event, data)

Invokes a remote procedure and waits for its response.

```javascript
const result = await ipc.invoke('greet', { name: 'Bob' });
console.log(result);  // Outputs: Hello, Bob!
```

#### close()

Closes the Socket.IO connection.

```javascript
ipc.close();
```

## Full Example

```javascript
import JsIPC from '@itsmrmonday/jsipc';

async function main() {
    const ipc = new JsIPC(5000);

    ipc.on('greet', (data) => {
        return `Hello, ${data.name}!`;
    });

    try {
        const result = await ipc.invoke('greet', { name: 'Bob' });
        console.log(result);  // Outputs: Hello, Bob!
    } catch (error) {
        console.error('Error:', error);
    } finally {
        ipc.close();
    }
}

main();
```

This example sets up a JsIPC client, registers a 'greet' handler, invokes a remote 'greet' procedure, and then closes the connection.

## Interoperability with PyIPC

JsIPC is designed to work seamlessly with PyIPC. You can use JsIPC to connect to a PyIPC server running in a Python process, enabling powerful inter-process communication scenarios between JavaScript and Python applications.
npm package: @itsmworkbench/cli
Description: How to do a cli
Latest version: 0.3.12

# Overview

This is about the tenth time I have cut and pasted the same thing.

It's time to make a module that can do this for me!

# Config file

Most CLIs have some config. Not all but some. This might be
* Stored in '~/.xxx.json'
* Stored in the current directory
* Stored in a parent directory
* Stored in a directory xx hanging off a parent directory
* etc...
So many options so we abstract it

## Observations
* We need the config before we build the cli because often we use it in the construction of the cli.
* Often the config needs validating and errors reporting.
* We will probably need commands to look at the config and validate it for every CLI we build.
* We need to build the config... we might add things that aren't serializable to it: this is our dependency injection too

# Building the CLI

* We always need --version. It's hard to do that here so pass it in...
* We need the config before we build the cli
* We need to be able to add config commands to the cli (but not do it automatically)

# finding your version

In your main file. Because of the use of require it's hard to do this in a library.
```typescript
export function findVersion () {
  let packageJsonFileName = "../package.json";
  try {
    return require ( packageJsonFileName ).version
  } catch ( e ) {
    return "version not known"
  }
}

```
npm package: @itsmworkbench/indexing_mysql
Description: indexing data in mysql
Latest version: 0.3.12



```yaml
mysql-index:
   type: mysql
   scan:
      sql:   `SELECT * FROM person where last_updated > {sinceDate}` # Note the templating. If ignored always same
      connection:
          host: localhost
          port: 3306 # defaults to this anyway
          user: someName
          password: env variable name of password
          database: test
```


For testing mysql

```sql
CREATE DATABASE test;
USE test;


CREATE TABLE person (
    id INT AUTO_INCREMENT PRIMARY KEY,
    first_name VARCHAR(50) NOT NULL,
    last_name VARCHAR(50) NOT NULL,
    email VARCHAR(100) NOT NULL,
    date_of_birth DATE,
    last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);


INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('John', 'Doe', 'john.doe@example.com', '1980-01-01');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Jane', 'Smith', 'jane.smith@example.com', '1990-02-15');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Michael', 'Johnson', 'michael.johnson@example.com', '1985-05-30');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Emily', 'Davis', 'emily.davis@example.com', '1992-07-22');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('William', 'Brown', 'william.brown@example.com', '1975-12-05');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Jessica', 'Williams', 'jessica.williams@example.com', '1988-11-10');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('David', 'Jones', 'david.jones@example.com', '1995-03-14');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Sophia', 'Garcia', 'sophia.garcia@example.com', '1993-09-08');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('James', 'Martinez', 'james.martinez@example.com', '1982-06-25');

INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Olivia', 'Hernandez', 'olivia.hernandez@example.com', '1991-01-20');

```
npm package: @itsmworkbench/operator
Description: Information about the operator
Latest version: 0.3.12

# What are these for?

* When we start we don't have operator data so we need to ask the user for their email etc
* Then we don't have any data about the ticket, so we need to ask the user for that too

This is easily dealt with by a partial function, defaulting to normal 'chat'

Note this makes these composible...

# What are the questions?

I think that we are going to need others
* When we want to do sql we will find we don't have the database connection details
* When we want to send an email we will find we don't have the email server details
* When we need to access LDAP we will find we don't have the LDAP server details

Thus when we are wanting to do a sql question we probably want
* normal questions
* plus 'sql detail questions'
* Then the sql display.

Same for LDAP/etc...

Thus we are basically reverse chaining the questions

# Reverse Chaining

That leads to an interesting question.

The whole thing is really reverse chaining once we know the ticket type. Very little AI needed.

So do we just get the AI to compile down to backward chaining? In some horn-clauses  sense that is the natural language
of expert systems and we are effectively making a simple expert system here.

Some thoughts on that
https://chat.openai.com/share/9a18f799-501b-473f-9204-21876b24f62f

Example:

To finish the ticket we need to do the following:
* Validated the ticket is closed

To validate the ticket is closed
* 

To validate the ticket is fixed we need to do the following:
* Check the ticket has been validated
* Check the ticket has been resolved
npm package: @itsmworkbench/questions
Description: The chat client has some initial questions it needs to ask
Latest version: 0.0.3

# What are these for?

* When we start we don't have operator data so we need to ask the user for their email etc
* Then we don't have any data about the ticket, so we need to ask the user for that too

This is easily dealt with by a partial function, defaulting to normal 'chat'

Note this makes these composible...

# What are the questions?

I think that we are going to need others
* When we want to do sql we will find we don't have the database connection details
* When we want to send an email we will find we don't have the email server details
* When we need to access LDAP we will find we don't have the LDAP server details

Thus when we are wanting to do a sql question we probably want
* normal questions
* plus 'sql detail questions'
* Then the sql display.

Same for LDAP/etc...

Thus we are basically reverse chaining the questions

# Reverse Chaining

That leads to an interesting question.

The whole thing is really reverse chaining once we know the ticket type. Very little AI needed.

So do we just get the AI to compile down to backward chaining? In some horn-clauses  sense that is the natural language
of expert systems and we are effectively making a simple expert system here.

Some thoughts on that
https://chat.openai.com/share/9a18f799-501b-473f-9204-21876b24f62f

Example:

To finish the ticket we need to do the following:
* Validated the ticket is closed

To validate the ticket is closed
* 

To validate the ticket is fixed we need to do the following:
* Check the ticket has been validated
* Check the ticket has been resolved
npm package: @itsmycargo/batten
Description: Batten - Basic Components
Author: ItsMyCargo OpenSource
Latest version: 1.6.3

# [Batten](https://en.wikipedia.org/wiki/Sail_batten)

**The front-end framework for building experiences for ItsMyCargo**

Batten is

## Components

Component     | NPM Package        | Description
--------------|--------------------|------------
batten        | ![npm][npm-core]   | Core UI Components

## Contributing

This repository uses lerna for building multiple NPM packages from single repository. Most commands are used via
`lerna`.

### Local Development

To develop Batten locally, especially with existing project that uses batten, NPM packagers can be linked together.

First install lerna globally (A tool for managing JavaScript projects with multiple packages.)

    $ yarn global add lerna

Then run inside `batten` root directory command:

    $ lerna exec yarn link

Then inside your project link components you need, for example:

    $ npm/yarn link @itsmycargo/batten

To build new components while testing, you can run build in watch mode:

    $ yarn build:watch

[npm-core]: https://img.shields.io/npm/v/@itsmycargo/batten-core.svg?style=flat-square
npm package: @itsmycargo/code-style
Description: ItsMyCargo Code Linters for Typescript and CSS
Author: marcelo.leonardi@itsmycargo.com.br
Latest version: 0.0.3

# ItsMyCargo - Coding & Stylesheet Ruleset 

Common Code Style Guides and Configuration Packages

## [Typescript](typescript/README.md)
[VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin)

Command for running linter
```
tslint './**/*.ts?(x)'
```


## [Stylesheet](stylesheet/README.md)
[VSCode Extension](https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint)

Command for running linter
```
stylelint './**/*.scss'
```
npm package: @itsnep/tl
Description: Simple fully type-safe translation library for TypeScript.
Author: itsnep
Latest version: 1.0.0

# @itsnep/tl

Simple fully type-safe translation library for TypeScript.

## Installation

```bash
npm install @itsnep/tl
# or
pnpm add @itsnep/tl
# or
yarn add @itsnep/tl
```

## Example usage

```typescript
import { TL } from '@itsnep/tl';

// Create message. make sure to use **const** in order for typing to work correctly.
export const validation = {
  required: '{attribute} is required.',
  numeric: '{attribute} must be a number.',
  unique: '{attribute} already used.',
  min: {
    numeric: '{attribute} must be atleast {min}.',
    file: '{attribute} must be atleast {min} kilobyte.'
  },
  ...
} as const; // <- **const** is required

// Create translation instance
export const tl = TL({ validation });

// Usage
console.log(tl('validation.required', { attribute: 'Email' })); // Output: "Email is required."
```

## License

MIT
npm package: @itspeetah/usertdbref
Description: Custom react hook to access a Firebase Realtime Database reference
Author: itsPeetah
Latest version: 1.0.1

# useRTDBRef

Custom React Hook to access a Firebase Realtime Database Reference

# Usage

```js
import useRTDBRef from "@itspeetah/usertdbref"
import {useEffect} from react;

function MyComponent() {
  const myRef = useRTDBRef(config, "reference/path/or/query");

  useEffect(() => {
    onValue(myRef, (data) => console.log("Received data!", data));
  }, []);

  // ...
}
```
npm package: @itsprakash87/packer
Description: A simple module bundler
Author: Prakash Sharma
Latest version: 1.0.0

# packer
A simple no configuration module bundler. 

## Supported Features

- Support js, css, image and font files.
- Dynamically loading the js and css.
- Code splitting.
- Default support for jsx syntax.
- Bundle name with bundle hash to support caching.
- Minified js files.

## Install

```
npm install -g @itsprakash87/packer
```

## Use

```
packer ./main.js -o ./build
```

## CLI Options
<table>
  <tr><td width="150"><b>Options</b></td><td><b>Use</b></td></tr>
  <tr><td>--output or -o</td><td>Output directory.</td></tr>
  <tr><td>--publicPath</td><td>Public path of bundled assets.</td></tr>
  <tr><td>--babelrc</td><td>Path to custom babel configuration file. Packer will use that config to parse js files.</td></tr>
  <tr><td>--template</td><td>Path to HTML template. Packer will inject the js and css bundle urls and create a new HTML file in output directory.</td></tr>
  <tr><td>--nominify</td><td>Skip minifying js files.</td></tr>
</table>

## Example

#### Command line example
![Command line](./examples/gifs/cli.gif)

#### Lazy loading example
![Lazy loading](./examples/gifs/lazy_loading.gif)
npm package: @itsquarehub/json-serialization
Description: A typescript library for deserializing JSON to object and serializing object to JSON.
Author: Arrian Pascual
Latest version: 0.0.5

# json-serialization

> A typescript library for JSON object serialization.

## Install

```bash
npm install @itsquarehub/json-serialization
```

or

```bash
yarn add @itsquarehub/json-serialization
```

## Usage

> Note:
> Always use the JsonProperty() to decorate the property you want to serialize/deserialize,
> otherwise it will ignore it.

Example Model Class
```typescript
export class Person {
  @JsonProperty()
  public firstName: string = undefined;

  @JsonProperty()
  public lastName: string = undefined;

  public get fullName(): string {
    return `${this.firstName} ${this.lastName}`;
  }
}
```

Example on how to use the deserialization
```typescript
import { JsonProperty, deserialize } from '@itsquarehub/json-serialization';

const jsonObject: any = {
  firstName: 'John',
  lastName: 'Doe'
};

export class ApiService {
  public getPerson(): Person {
    return deserialize(Person, jsonObject);
  }
}
```

Example on how to use the serialization
```typescript
import { serialize } from '@itsquarehub/json-serialization';

const personObject: Person = new Person();
personObject.firstName = 'John';
personObject.lastName = 'Doe';

export class ApiService {

  public setPerson(): Person {
    return serialize(personObject);
  }
}
```

You can also set your custom deserializer or serializer and it will output based on the predicate
```typescript
import { deserialize, serialize, IJsonDeserializer, IJsonSerializer } from '@itsquarehub/json-serialization';

export enum Gender {
  Male = 1,
  Female = 2
}

export class GenderSerialization implements IJsonSerializer, IJsonDeserializer {
  public serialize(value: any): any {
    return `${Gender[value]}`;
  }

  public deserialize(value: any): any {
    return Gender[value];
  }
}

export class Person {
  @JsonProperty()
  public firstName: string = undefined;

  @JsonProperty({
    serializer: GenderSerialization,
    deserializer: GenderSerialization
  })
  public gender: Gender = undefined;
}

const personObject: Person = new Person();
personObject.firstName = 'John';
personObject.lastName = 'Doe';
personObject.gender = Gender.Male;

export class ApiService {

  public setPerson(): Person {
    return serialize(personObject);
  }
}
```

## License

[MIT](http://vjpr.mit-license.org)

[npm-image]: https://img.shields.io/npm/v/live-xxx.svg
[npm-url]: https://npmjs.org/package/live-xxx
[travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
[travis-url]: https://travis-ci.org/live-js/live-xxx
[coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
[coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master