open-index/open-npm huggingface dataset:
npm package: @ocelotjungle/case-converters
Description: Tools to switch name's casings
Author: OcelotJungle
Latest version: 1.0.0

# @ocelotjungle/case-converters
This package contains tools for changing casing.

---

## Tools

### Strategies
Each strategy encapsulates specific casing.
Strategy can:
- `parse` string to tokens
- `join` tokens to string

List of available strategies (name - casing example = tokens):
1. `Snake` - `snake_case_42` = [snake, case, 42]
2. `Const` - `CONST_CASE_42` = [CONST, CASE, 42]
3. `Kebab` - `kebab-case-42` = [kebab, case, 42]
5. `Camel` - `camelCase42` = [camel, Case, 42]
6. `Pascal` - `PascalCase42` = [Pascal, Case, 42]
7. `Unknown` - `foo_BarBaz42-buzz` = [foo, Bar, Baz, 42, buzz]

### Strategy Factory
Creates Strategy based on passed strategy name.
Throws Error on unexisting strategy.

### `CaseTransformer`
Encapsulates casing-to-casing transformation.

### Deep Transform Factory
Performs deep casing transform in passed object.
Supports:
- ignore predicate: if true, then string won't be transformed;
- type of result;

### Deep Transform Method
Uses factory to deep transform, but in single-use way.
Also supports ignore predicate and result type.

### Presets
They are functions with preconfigured transformers.
Imported from `@ocelotjungle/case-converters/presets`
npm package: @ocelotjungle/di
Description: Simple dependency injection.
Author: OcelotJungle
Latest version: 1.0.1

# @ocelotjungle/di
...







This package provides a Logger class with configurable outputs and levels, and ability to create subloggers.

---

## Usage

### Constructor
It takes either nothing or just logger name or an options object:
- `name` is a name of a logger;
- `options`:
  - `dateFormatter` is a function that stringifies Date, can be one of presets or custom;
  - `levels` can be:
    - max level that is written to logs (for example, `error`, then warnings, info etc won't be printed);
    - object with explicitly defined levels;
  - `unite` - if `true`, then all outputs are accumulated till you use `end()`;
  - `defaultLogOptions` is a log options that are applied to every log by default;

### Methods

#### `withConsole`
Adds console to logger outputs. Can be default (`global.console`) or custom.

#### `withFiles`
Adds files to logger outputs:
- `folder` is an absolute path or relative to project root path where logs will be written;
- `name` is a left log files name (`*name*(.suffix)?.extension`);
- `extension` is a log files extension (`name(.suffix)?.*extension*`);
- `levels` is similar to `constructor`'s options `levels`, except `common` level, which is general file for all logs;

#### Logging functions
- `error` - level 1, errors;
- `warn` - level 2, warnings;
- `info` - level 3, info messages;
- `dev` - level 4, info messages for development/debugging;
- `end` - frees accumulated messages if `unite`, else does nothing;

#### Utils
- `sub` - creates sublogger, copying the master logger parameters;
- `bound` - returns a scope of logger functions, bound to the logger;

## Examples
```ts
const logger = new Logger("master logger").withConsole()
logger.info("sample info message") // [iso-datetime] (master logger) ||| sample info message

const sublogger = logger.sub("sublogger", unite = true)
const { dev, env } = sublogger
dev("dev message 1") // prints nothing
dev("dev message 2") // prints nothing
end() // prints both previous messages in one operation, not broken my any other logger intermediate output

const subsublogger = sublogger.sub("subsublogger", unite = false, { depth: null })
subsublogger.error({ foo: { bar: { ... } } }) // prints argument inspected with no depth constraint, as console.dir(..., { depth: null }) would
```
npm package: @ocelotjungle/logger
Description: Configurable logger with subloggers and file support
Author: OcelotJungle
Latest version: 1.0.2

# @ocelotjungle/logger
This package provides a Logger class with configurable outputs and levels, and ability to create subloggers.

---

## Usage

### Constructor
It takes either nothing or just logger name or an options object:
- `name` is a name of a logger;
- `options`:
  - `dateFormatter` is a function that stringifies Date, can be one of presets or custom;
  - `levels` can be:
    - max level that is written to logs (for example, `error`, then warnings, info etc won't be printed);
    - object with explicitly defined levels;
  - `unite` - if `true`, then all outputs are accumulated till you use `end()`;
  - `defaultLogOptions` is a log options that are applied to every log by default;

### Methods

#### `withConsole`
Adds console to logger outputs. Can be default (`global.console`) or custom.

#### `withFiles`
Adds files to logger outputs:
- `folder` is an absolute path or relative to project root path where logs will be written;
- `name` is a left log files name (`*name*(.suffix)?.extension`);
- `extension` is a log files extension (`name(.suffix)?.*extension*`);
- `levels` is similar to `constructor`'s options `levels`, except `common` level, which is general file for all logs;

#### Logging functions
- `error` - level 1, errors;
- `warn` - level 2, warnings;
- `info` - level 3, info messages;
- `dev` - level 4, info messages for development/debugging;
- `end` - frees accumulated messages if `unite`, else does nothing;

#### Utils
- `sub` - creates sublogger, copying the master logger parameters;
- `bound` - returns a scope of logger functions, bound to the logger;

## Examples
```ts
const logger = new Logger("master logger").withConsole()
logger.info("sample info message") // [iso-datetime] (master logger) ||| sample info message

const sublogger = logger.sub("sublogger", unite = true)
const { dev, env } = sublogger
dev("dev message 1") // prints nothing
dev("dev message 2") // prints nothing
end() // prints both previous messages in one operation, not broken my any other logger intermediate output

const subsublogger = sublogger.sub("subsublogger", unite = false, { depth: null })
subsublogger.error({ foo: { bar: { ... } } }) // prints argument inspected with no depth constraint, as console.dir(..., { depth: null }) would
```
npm package: @ocelotlstudio/cfdi-pdf
Description: Creates a pdf based on an XML CFDI
Author: OcelotlStudio
Latest version: 1.0.7

# cfdi-pdf

A small library for generate xml CFDI 3.3 to PDF

## How to install

### ES6 module

```bash
npm install --save @ocelotlstudio/cfdi-pdf
```

or with yarn

```bash
yarn add @ocelotlstudio/cfdi-pdf
```

## Usage

Then you're ready to generate pdf:

Simple Usage

```javascript
import CfdiPdf from '@ocelotlstudio/cfdi-pdf';

try {
    const xmlString = `<?xml version="1.0" encoding="utf-8"?>
        <cfdi:Comprobante Version="3.3" ...>
            ...
        </cfdi:Comprobante>`;
    /**
     * Function to get pdf from valid xml cfdi string
     * @param {string} xml
     * @param {Options=} options
     * @returns {Promise<string>} a pdf in base64 string
     */
    const parserData = await CfdiPdf.generatePdf(xmlString);
} catch (e) {
    console.log(e);
}
```

With options

```javascript
import CfdiPdf from '@ocelotlstudio/cfdi-pdf';

try {
    const xmlString = `<?xml version="1.0" encoding="utf-8"?>
        <cfdi:Comprobante Version="3.3" ...>
            ...
        </cfdi:Comprobante>`;
    const options = {
        text: 'onlytest',
        image: 'imageinbase64',
        cadenaOriginal: 'for visualice correct cadena original',
        address: 'receptor address',
    };

    /**
     * Function to get pdf from valid xml cfdi string
     * @param {string} xml
     * @param {Options=} options
     * @returns {Promise<string>} a pdf in base64 string
     */
    const parserData = await CfdiPdf.generatePdf(xmlString, options);
} catch (e) {
    console.log(e);
}
```

## Features

-   Generate PDF from types: I, E, T and P

## License

MIT
npm package: @ocelotlstudio/xlsxbank
Description: A small library for parsing bank movements in spreadsheet or csv files
Author: OcelotlStudio
Latest version: 1.1.2

# Spreadsheet Bank

A small library for parsing bank movements in spreadsheet or csv files to an array object. Actually only for mexican banks.

## How to install

### ES6 module

```bash
npm install --save @ocelotlstudio\xlsxbank
```

or 

```bash
pnpm add @ocelotlstudio\xlsxbank
```

## Usage

Then you're ready to process first spreadsheet:

Simple Usage

```javascript
import { processSheet } from '@ocelotlstudio\xlsxbank';

/* 
 * fileBuffer of type buffer or arraybuffer or string
 */
const result = processSheet(fileBuffer);
if (typeof result === 'string'){
  //Error msg
}else{
  //Array<Movements>
  /*
   * [
   *  { 
   *    date: Date,
   *    description: string,
   *    credit: number,
   *    debit: number 
   *  }
   * ]
   */
}
```

With type option for xlsx read file

```javascript
import { processSheet } from '@ocelotlstudio\xlsxbank';

/* 
 * @fileBuffer: string | ArrayBuffer | Buffer
 * @type: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string'
 */
const result = processSheet(fileBuffer, type);
if (typeof result === 'string'){
  //Error msg
}else{
  //Array<Movements>
  /*
   * [
   *  { 
   *    date: Date,
   *    description: string,
   *    credit: number,
   *    debit: number 
   *  }
   * ]
   */
}
```

## Features

* Support spreadsheet or csv files.
* Look for differents date formats and process to objects of type Date.

## License

MIT