open-index/open-npm huggingface dataset:
npm package: @jezzs2k/react-native-controlled-mentions
Description: Fully controlled React Native mentions component
Author: jezzs2k
Latest version: 2.2.9

### Original library react-native-controlled-mentions [![npm version][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/react-native-controlled-mentions
[npm-url]: https://npmjs.org/package/react-native-controlled-mentions
npm package: @jf-code/accordion
Description: Accordion component
Latest version: 1.1.0

# VanillaJS Accordion

This is a dependency free accordion

## Usage

### Template

```html
<div class="accordion">
    <a class="accordion__trigger" href="#" data-target="item-1">First item</a>
    <div class="accordion__content" id="item-1">First item content</div>
    <a class="accordion__trigger" href="#" data-target="item-2">Second item</a>
    <div class="accordion__content" id="item-2">Second item content</div>
</div>
```

### Javascript Initialization

```javascript
// instantiate with options
let instance = new Accordion('.accordion', {
    selectors: {
        trigger: '.accordion__trigger',
        content: '.accordion__content'
    },
    classes: {
        active: 'is-active'
    },
    active: false,
    expandable: false,
    callbacks: {},
    errorMessages: {}
});
// initialize
instance.init();
```


### Options

| Name       | Description                                      |  Type   |                                                          Default |
| ---------- | ------------------------------------------------ | :-----: | ---------------------------------------------------------------: |
| selectors  | Element Selectors                                | Object  | {trigger: '.accordion__trigger', content: '.accordion__content'} |
| classes    | Element Classes                                  | Object  |                                            {active: 'is-active'} |
| active     | Index of initial active item                     | Number  |                                                               -1 |
| expandable | Can more than one item be open at the same time? | Boolean |                                                            false |
npm package: @jf/ajax
Description: OOP library for sending AJAX requests
Author: Joaquín Fernández
Latest version: 0.3.0

# jfAjax [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

OOP library for processing AJAX requests.

## Usage

[![npm install jfAjax](https://nodei.co/npm/jf-ajax.png?compact=true)](https://npmjs.org/package/jf-ajax/)

### Examples

#### NodeJS

```js
const jfAjax  = require('jf-ajax/build/jf.ajax.min');
// You need a lib implementing XMLHttpRequest interface.
const Xhr2    = require('xhr2');
const request = new jfAjax.request.Get(
    {
        debug : true, // To see headers and body
        xhr   : new Xhr2(),
        url   : 'http://localhost:3333/api/items'
    }
);
request.on('req-error',   e => console.log('ERROR: ', e.errors));
request.on('req-success', e => console.log('SUCCESS: ', e.response));
request.on('req-end',     e => console.log('END: -- Time: %dms', e.request.chrono.getTime()));
request.send();
```

#### Browser

```html
<script src="/path/to/jf.ajax.min.js"></script>
<script>
const request = new jf.ajax.request.Get(
    {
        // Placeholders for URL.
        data  : {
            itemId : 1
        },
        // You can omit this because XMLHttpRequest is used by default.
        xhr   : new XMLHttpRequest(),
        url   : 'http://localhost:3333/api/items/{itemId}'
    }
);
request.on('req-error',   e => console.log('ERROR: ', e.errors));
request.on('req-success', e => console.log('SUCCESS: ', e.response));
request.on('req-end',     e => console.log('END: -- Time: %dms', e.request.chrono.getTime()));
request.send();
</script>
```

### Extending jfAjax

You can implement your own logic extending classes provided by `jfAjax` library.

```html
<script src="/path/to/jf.ajax.min.js"></script>
<script>
//--------
class MyResponse extends jf.ajax.response.Default {
    //...
    getErrors()
    {
        return [
            // Errors customized by class
        ];
    }
    //...
}
//--------
class MyApiItemsGet extends jf.ajax.request.Get {
    constructor(config)
    {
        super(
            Object.assign(
                {
                    url      : 'http://localhost:3333/api/items',
                    response : new MyResponse(),
                    // You can use another class implementing XMLHttpRequest 
                    // interface for sending request, e.g. jfXhrSimulate.
                    xhr      : new XMLHttpRequest()
                },
                config
            )
        );
    }
    
    _onRequestError(e)
    {
        super._onRequestError(e);
        this.showErrors(e.errors);
    }
    
    _onRequestSuccess(e)
    {
        super._onRequestSuccess(e);
        this.showItems(e.response);
    }
    
    showErrors(errors)
    {
        // Code for rendering errors in browser.
    }
    
    showItems(items)
    {
        // Code for rendering items in browser.
    }
}
//--------
new MyApiItemsGet().send();
</script>
```
npm package: @jf/cc2sep
Description: Transform a camelized string into a lowercased one using a custom separator and accepting unicode uppercase chars.
Author: Joaquín Fernández
Latest version: 2.0.0

# @jf/cc2sep [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install @jf/cc2sep](https://nodei.co/npm/@jf/cc2sep.png?compact=true)](https://npmjs.org/package/@jf/cc2sep/)

Transform a camelized string into a lowercased one using a custom separator and accepting unicode uppercase chars.

You can modify `regexp` property for customizing the text transformations in your application.

## Arguments

- text: Text to convert.
- separator: Separator to use between words (`-` by defatul).
- trim: `true` if you want to remove separators beginning or ending text (`true` by default).

## Examples

### cc2sep(text)

```
'onceuponatime'    => 'onceuponatime'
'onceUponATime'    => 'once-upon-a-time'
'OnceUponATime'    => 'once-upon-a-time'
'ONCE UPON A TIME' => 'o-n-c-e u-p-o-n a t-i-m-e'
'once-upon-a-time' => 'once-upon-a-time'
'innerHTML'        => 'inner-h-t-m-l'
'ÁáááÉéééÍíÓóó'    => 'áááá-éééé-íí-óóó'
```

### cc2sep(text, '-', false)

```
'OnceUponATime'    -> '-once-upon-a-time'
'ONCE UPON A TIME' -> '-o-n-c-e -u-p-o-n -a -t-i-m-e'
'ÁáááÉéééÍíÓóó'    -> '-áááá-éééé-íí-óóó'
```
npm package: @jf/chrono
Description: Simple class for using chronometers and timers in applications.
Author: Joaquín Fernández
Latest version: 1.0.0

# jfChrono [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Simple class for using chronometers and timers in applications.

## Usage

[![npm install jfChrono](https://nodei.co/npm/jf-chrono.png?compact=true)](https://npmjs.org/package/jf-chrono/)

### Examples

#### Getting AJAX request time for stats

```js
const jfChrono = require('jf-chrono');
const chrono = new jfChrono();
ajax.on(
    'end', 
    () => {
        chrono.stop();
        console.log('Request time (ms): %d', chrono.getTime())
    }
);
chrono.start();
ajax.doRequest();
```

#### Timers

Timer can be stopped and resumed using methods `startTimer` and `stopTimer`.

```js
const jfChrono = require('jf-chrono');
let count      = 1;
function timer()
{
    console.log('Doing action %s', count);
    chrono.startTimer(
        1000, 
        (chrono) => {
            const _time = chrono.getTime();
            // 5s 
            if (_time > 5000)
            {
                onEndTimer(chrono);
            }
        }
    );
}
function onEndTimer(chrono)
{
    chrono.stopTimer();
    if (++count < 5)
    {
        timer();        
    }
    else
    {
        console.log('Total time: %d', chrono.getTime());
    }
}
const chrono = new jfChrono();
chrono.start();
timer();
```

#### Timing actions

You can use several timers if you want to create reports of all actions taken.

```js
function showStats()
{
    console.log('Parsing time: %d', jfChrono.create('parse').getTime());
    console.log('Analyzing time: %d', jfChrono.create('analyze').getTime());
    console.log('Reporting time: %d', jfChrono.create('report').getTime());
    console.log('Total time: %d', jfChrono.create('process').getTime());
}
const jfChrono = require('jf-chrono');
jfChrono.create('process').start();
// Preparing actions
jfChrono.create('parse').start();
// Parse files
// ...
// ...
jfChrono.create('parse').stop();
jfChrono.create('analyze').start();
// Analyze files
// ...
// ...
jfChrono.create('analyze').stop();
jfChrono.create('report').start();
// Creating reports
// ...
// ...
jfChrono.create('report').stop();
jfChrono.create('process').stop();
// ...
showStats();
```
npm package: @jf/data-types
Description: Base classes for handling data types using OOP.
Author: Joaquín Fernández
Latest version: 2.3.3

# jfDataTypes [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install jf-data-types](https://nodei.co/npm/jf-data-types.png?compact=true)](https://npmjs.org/package/jf-data-types/)

Base classes for handling data types using OOP.
npm package: @jf/factory
Description: Simple class factory and registry for using with dependency injection.
Author: Joaquín Fernández
Latest version: 3.0.0

# @jf/factory [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install @jf/factory](https://nodei.co/npm/@jf/factory.png?compact=true)](https://npmjs.org/package/@jf/factory/)

Simple class factory and registry for using with dependency injection.

## Usage

### Dependency injection

```js
class MyClass
{
    log()
    {
        console.log('MyClass');
    }
}

class Main
{
    log()
    {
        factory.create('MyClass').log();
    }
}

const factory = Factory.i(); // Or `new Factory()`;
factory.register('MyClass', MyClass);
new Main().log(); // MyClass

//-----------------------------------------------------------------------------
// Somebody need modify MyClass behavior and to replace all uses of MyClass
//-----------------------------------------------------------------------------
class MyOtherClass extends MyClass
{
    log()
    {
        console.log('MyOtherClass');
    }
}
factory.register('MyClass', MyOtherClass);
new Main().log(); // MyOtherClass
```

### Several factories

```js
//-----------------------------------------------------------------------------
// Factory for services.
//-----------------------------------------------------------------------------
const services = Factory.i('services');
service.register('api/projects', ApiProjects);

//-----------------------------------------------------------------------------
// Factory for models.
//-----------------------------------------------------------------------------
const models = Factory.i('models');
models.register('Project', Project);

//-----------------------------------------------------------------------------
// In other file.
//-----------------------------------------------------------------------------
const service = Factory.i('services').create(
    'api/projects',
    { 
        model : Factory.i('models').create('Project'),
        path  : '/api/v1/projects' 
    }
);
```
npm package: @jf/format-decimal
Description: Format thousands and decimals with custom separator
Author: Joaquín Fernández
Latest version: 1.0.0

# @jf/format-decimal [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Format thousands and decimals with custom separator: 1.000.000,00

## Options

You can pass a configuration object as second parameter with the following keys:

* **decimal:** Symbol to use for decimal point (default: `,`).
* **precision:** Number of decimal digits to show (default: `2`).
* **thousands:** Symbol to use for thousands separator (default: `.`).

## Usage

[![npm install @jf/format-decimal](https://nodei.co/npm/@jf/format-decimal.png?mini=true)](https://npmjs.org/package/@jf/format-decimal/)

```js
const formatDecimal = require('format-decimal');

console.log(formatDecimal(123456.789)); // 123.456,79
console.log(
    formatDecimal(
        123456.789,
        {
            decimal   : '.',
            precision : 1,
            thousands : ','
        }
    )
); // 123,456.8
```
npm package: @jf/index
Description: Build index of EcmaScript/CommonJS package.
Author: Joaquín Fernández
Latest version: 1.0.0

# @jf/index [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Build index of EcmaScript package.
Index file can be used as `entry` key of webpack configuration.

## Features

- You can use your own template using `-t` option.
- It's a class, so you can extend it and overwrite any method.

## Usage

[![npm install @jf/index](https://nodei.co/npm/@jf/index.png?compact=true)](https://npmjs.org/package/@jf/index/)

```bash
node jf-index -i /path/to/srcdir
```

Some info can be retrieved from `package.json`:

```bash
node jf-index -i /path/to/srcdir -p /path/to/package.json
```

## Example

Directory tree:

```bash
└─┬ base.mjs
  └─┬ type
    └─┬ base.mjs
      ├─┬ collection
      │ ├── base.mjs
      │ └── users.mjs
      └─┬ item
        ├── base.mjs
        └── user.mjs
```

### EcmaScript
Index generated:

```js
import Base                from './base.mjs';
import TypeBase            from './type/base.mjs';
import TypeCollectionBase  from './type/collection/base.mjs';
import TypeCollectionUsers from './type/collection/users.mjs';
import TypeItemBase        from './type/item/base.mjs';
import TypeItemUser        from './type/item/user.mjs';
/**
 * Archivo índice creado con `@jf/index`.
 *
 * @author  Joaquín Fernández
 * @created Fri Apr 21 2017 00:25:03 GMT+0200 (CEST)
 * @version 0.1
 */
export default {
    Base : Base,
    type : {
        Base : TypeBase,
        collection : {
            Base : TypeCollectionBase,
            Users : TypeCollectionUsers
        },
        item : {
            Base : TypeItemBase,
            User : TypeItemUser
        }
    }
};
```

### NodeJS

Index generated:

```js
const Base                = require('./base.mjs');
const TypeBase            = require('./type/base.mjs');
const TypeCollectionBase  = require('./type/collection/base.mjs');
const TypeCollectionUsers = require('./type/collection/users.mjs');
const TypeItemBase        = require('./type/item/base.mjs');
const TypeItemUser        = require('./type/item/user.mjs');
/**
 * Archivo índice creado con `@jf/index`.
 *
 * @author  Joaquín Fernández
 * @created Fri Apr 21 2017 00:25:03 GMT+0200 (CEST)
 * @version 0.1
 */
module.exports = {
    Base : Base,
    type : {
        Base : TypeBase,
        collection : {
            Base : TypeCollectionBase,
            Users : TypeCollectionUsers
        },
        item : {
            Base : TypeItemBase,
            User : TypeItemUser
        }
    }
};
```
npm package: @jf/json-parse
Description: Parse a JSON file replacing all files included with their contents.
Author: Joaquín Fernández
Latest version: 1.1.0

# jf-json-parse [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install jf-json-parse](https://nodei.co/npm/jf-json-parse.png?mini=true)](https://npmjs.org/package/jf-json-parse/)

Parse a JSON file replacing all files included with their contents.
If a file does not exist the text is not replaced.


### Example

```js
// a.json
{
    "a1" : "Texto del archivo A",
    "a2" : "archivo a.json"
}
```

```js
// b.json
{
    "b1" : "Archivo B",
    "b2" : "./a.json"
}
```

```js
// index.json
{
    "a" : "a.json",
    "b" : "./b.json",
    "c" : "Clave c",
    "d" : "d.json",
    "e" : "/tmp/e.json"
}
```

```js
const jfJsonParse = require('jf-json-parse');

console.log(
    jfJsonParse('./index.json'),
    {
        '/tmp/e.json' : '"fake content"'
    }
);
/*
{
    "a": {
        "a1": "Texto del archivo A",
        "a2": "archivo a.json"
    },
    "b": {
        "b1": "Archivo B",
        "b2": {
            "a1": "Texto del archivo A",
            "a2": "archivo a.json"
        }
    },
    "c": "Clave c",
    "d": "d.json",
    "e": "fake content"
}
*/
```

### Cache

You can pass an object as second parameter as cache.
If the key exists in cache, this value will be used instead file on disk.

After parse JSON, in cache object you will have all the files that were tried to read.
So you can pass the same cache object between calls to `jfJsonParse` and no files
will be read twice.

```js
const jfJsonParse = require('jf-json-parse');
const cache       = {};

jfJsonParse('./index.json', cache);

// There is no file readings because for this JSON all files are in cache.
jfJsonParse('./index.json', cache);

// For this JSON only will read x.json because there is not in cache.
// z.json: { "a": "a.json", x: "x.json" }
jfJsonParse('./z.json', cache);
```
npm package: @jf/logger
Description: Class for manipulating logs and traces. Can be used as base class for reporting class or node scripts.
Author: Joaquín Fernández
Latest version: 2.0.0

# jfLogger [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Class for manipulating logs and traces.

Can be used as base class for reporting class or node scripts.

Extend [jfObject](https://www.npmjs.com/package/jf-object) inheriting all its features and functionalities.

Use [jfTranslations](https://www.npmjs.com/package/jf-translations) so messages can be translated in other languages.

## Usage

[![npm install jfLogger](https://nodei.co/npm/jf-logger.png?compact=true)](https://npmjs.org/package/jf-logger/)

### Example

```js
const jfLogger = require('jf-logger');
jfLogger.translations.addLanguage('en');
// Using new
const logger = new jfLogger();
// As singleton
const logger = jfLogger.i();
logger.log( // 12:34:56 [jfLogger  ] You must set field `name`
    'warn', 
    '', // If empty, class name is used.
    'Debes asignar el campo `%s`',
    'name'
);
logger.log( // 12:34:56 Min length for `Description` is 10 chars.
    'warn', 
    false, // If false, name is hidden.
    'La longitud mínima para `{name}` es {minLength}',
    {
        name      : 'Description',
        minLength : 10
    }
);
```

### Removing/changing colors

If you want differents colors or not colors at all you can overwrite
`addColorsToLogParams`.

If you use an empty function you will remove all colors in parameters.
npm package: @jf/node
Description: Node class for manipulating double chained list
Author: Joaquín Fernández
Latest version: 2.0.1

# @jf/node [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install @jf/node](https://nodei.co/npm/@jf/node.png?compact=true)](https://npmjs.org/package/@jf/node/)

Node class for manipulating double chained list.
npm package: @jf/node-env-tools
Description: Tools for working with process.env.NODE_ENV including check environment.
Author: Joaquín Fernández
Latest version: 2.0.0

# node-env-tools [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install node-env-tools](https://nodei.co/npm/node-env-tools.png?compact=true)](https://npmjs.org/package/node-env-tools/)

Tools for working with `process.env`.

## Examples

```js
const net = require('node-env-tools');

// Use value instead of process.env. 
console.log(net.load({ ... }));

// Get key if exists, nested objects is allowed. 
console.log(net.get('a.b.c'));

// Check if key exists, nested objects is allowed.
console.log(net.has('a.b.c'));

// Set value.
console.log(net.set('NODE_ENV', 'testing'));

// Check if NODE_ENV is 'production' or '"production"'
console.log(net.isEnv('production'));

// Check if NODE_ENV is 'production'
console.log(net.isEnv('production', false));

// Check if NODE_ENV is 'dev', '"dev"', 'development' or '"development"'
console.log(net.isDev());

// Check if NODE_ENV is 'pro', '"pro"', 'production' or '"production"'
console.log(net.isPro());

// Check if NODE_ENV is 'test', '"test"', 'testing' or '"testing"'
console.log(net.isTest());
```
npm package: @jf/object
Description: Class providing dot path syntax for properties, JSON serialization, singletons and more.
Author: Joaquín Fernández
Latest version: 4.0.0

# @jf/object [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Class providing dot path syntax for properties, JSON serialization, singletons and more.

## Usage

[![npm install @jf/object](https://nodei.co/npm/@jf/object.png?compact=true)](https://npmjs.org/package/@jf/object/)

### Objects as parameters

You can pass several objects and will be merged recursively.

```js
const obj = new jfObject(
    {
        a : {
            b : 0
            c : 2
        }
    },
    {
        a : {
            b : 1,
        }
    },
    {
        a : {
            c : 3
        }
    }
);
console.log(obj.toJSON()); // { a : { b : 1, c : 3 } }
```

### Dot notation

You can use dot notation in order to assign/retrieve/test nested objects.

```js
const obj = new jfObject();
obj.set('d.e.f', 5);
console.log(obj.toJSON()); // { d : { e : { f : 5 } } }
console.log(obj.get('d.e')); // { f : 5 }
console.log(obj.has('d.e.f')); // true
```

### Merging objects

Objects can be merged in 2 ways:

* **Recursively**: Use `obj.merge(...)`.
* **Overwrite existing keys**: Use `Object.assign(obj, ...)`

```js
const obj = new jfObject(
    {
        a : {
            b : 0
        }
    }
);
// Recursive merge
obj.merge(
    {
        a : {
            c : 1
        }
    }
);
console.log(obj.toJSON()); // { a : { b : 0, c : 1 } }
// Overwrite merge
Object.assign(
    obj,
    {
        a : {
            c : 2
        }
    }
);
console.log(obj.toJSON()); // { a : { c : 2 } }
```

### Iterating over properties

You can use new `ES6` loop `for..of`:

```js
const obj = new jfObject(
    {
        a : 1,
        c : 2,
        f : 3,
        h : 4
    }
);
for (const prop of obj)
{
    console.log('%s = %s', prop, obj[prop]);    
}
// a = 1
// c = 2
// f = 3
// h = 4
```

### Keys & values

If you need to split object into keys and values, you can use `split` or `toArray` methods.


```js
const obj = new jfObject(
    {
        a : 1,
        c : 2,
        f : 3,
        h : 4
    }
);
console.log(obj.split()); // { keys: [ 'a', 'c', 'f', 'h' ], values: [ 1, 2, 3, 4 ] }
console.log(obj.toArray());  // [ [ 'a', 1 ], [ 'c', 2 ], [ 'f', 3 ], [ 'h', 4 ] ]
```

### Singleton

If you need to share the same instance between differents external modules,
you can use static method `i()` in order to retrieve the same instance
anywhere in the app.

```js
class User extends jfObject
{
    // User class methods and properties
}
// Initialize the User instance on ajax response using external library:
function onAjaxResponse(data)
{
    //...
    User.i().setProperties(data);
    //...
}
// In UI, using external framework
<user-info data="{{User.i()}}" />
```
npm package: @jf/prop-sep
Description: Check, get, set and remove properties from nested objects using any separator.
Author: Joaquín Fernández
Latest version: 4.0.1

# @jf/prop-sep [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install @jf/prop-sep](https://nodei.co/npm/@jf/prop-sep.png?compact=true)](https://npmjs.org/package/@jf/prop-sep/)

Check, get, set and remove properties from nested objects using any separator.

```javascript
const propSep = require('@jf/prop-sep');
const obj     = {};
propSep.set(obj, 'a.b.c', 5);
console.log(obj); // { a : { b : { c : 5 } } }
```

Also, you can attach and detach this methods to objects and classes.

As instance methods:

```javascript
const propSep = require('@jf/prop-sep');

class Class {}
propSep.attach(Class);

const obj = new Class();
obj.set('a.b.c', 5);
console.log(obj); // { a : { b : { c : 5 } } }
```

As class methods:

```javascript
const propSep = require('@jf/prop-sep');

class Class {}
class Other extends Class {}
propSep.attach(Class, false);

const obj = {};
Class.set(obj, 'a.b.c', 5);
console.log(obj); // { a : { b : { c : 5 } } }
Other.set(obj, 'b', 1);
console.log(obj); // { a : { b : { c : 5 } }, b : 1 }
```

See [test file](./test.js) for examples.
npm package: @jf/sep2cc
Description: Transform a char separated string into a camelCase one using a custom separator and accepting unicode chars.
Author: Joaquín Fernández
Latest version: 2.0.0

# sep2cc [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install sep2cc](https://nodei.co/npm/sep2cc.png?compact=true)](https://npmjs.org/package/sep2cc/)

Transform a char separated string into a camelCase one using a custom separator and accepting unicode chars.

You can modify `chars` property for customizing the text transformations in your application.

## Examples

### toCamelCase

```
'onceuponatime'                 -> 'onceuponatime'
'once-upon-a-time'              -> 'onceUponATime'
'-once-upon-a-time'             -> 'OnceUponATime'
'-o-n-c-e -u-p-o-n -a -t-i-m-e' -> 'ONCE UPON A TIME'
'inner-h-t-m-l'                 -> 'innerHTML'
'-áááá-éééé-íí-óóó'             -> 'ÁáááÉéééÍíÓóó'
```
npm package: @jf/server-base
Description: A very simple wrapper for node webserver
Author: Joaquín Fernández
Latest version: 1.0.0

# jf-server-base [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install jf-server-base](https://nodei.co/npm/jf-server-base.png?compact=true)](https://npmjs.org/package/jf-server-base/)

A very simple wrapper for node webserver.

```js
// Receive log and save to disk.
const fs = require('fs');
require('jf-server-base').create(
    8888,
    (request, response, requestBody) => {
        fs.writeFileSync(
            `/tmp/request-${Date.now()}.log`, 
            JSON.stringify(requestBody)
        );
        response.writeHead(201);
        response.end();
    }
);
```

Callback will receive as third param the request body as object or string so you don't
need add listeners for retrieving body because `jfServerBase` exports other function, 
named `getBody`, for getting data of readable streams such as response and request 
parameters:

```js
const request  = require('http').request(
    {
        // Put request config here
    },
    response => require('jf-server-base').getBody(
        response,
        body => console.log(body)
    )
);
request.write(
    JSON.stringify(data)
);
request.end();
```
npm package: @jf/storage
Description: Classes and polyfills implementing Web Storage API
Author: Joaquín Fernández
Latest version: 2.0.1

# jf-storage 0.0.1 [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install jf-storage](https://nodei.co/npm/jf-storage.png?compact=true)](https://npmjs.org/package/jf-storage/)

Several classes and polyfills implementing Web Storage API.

You can store item in memory, cookies, files, browser storage, etc. Also, you can encrypt/decrypt data 
in storage using `jf.storage.serializer` classes, and obfuscate keys using key builders.

## Proxy

`jf.storage.Proxy` it's a proxy to other storages but allow us to do advanced things 
adding some behaviors through injection dependency. 

### Example

We want store data requested to servers with following requirements:

- Store data in files.
- Data in files must be stored using JSON format.
- Filename must be first 6 chars in `MD5` hash of URLs.
  If data is read from `http://joaquinfernandez.net/api/users/1`, filename will be `05fdf4.json`


```javascript
const jfStorageFile           = require('jf-storage-api/src/File');
const jfStorageKeyCrypto      = require('jf-storage-api/src/key/Crypto');
const jfStorageProxy          = require('jf-storage-api/src/Proxy');
const jfStorageSerializerJson = require('jf-storage-api/src/serializer/Json');

function doRequest(url)
{
    return {
        firstname : 'Homer',
        lastname  : 'Simpson'
    };    
}

const storage = new jfStorageProxy(
    {
        key        : new jfStorageKeyCrypto('md5', 6),
        serializer : new jfStorageSerializerJson(),
        storage    : new jfStorageFile('/path/to/cache/directory', '.json')
    }
);

// Read data from server.
const url      = 'http://joaquinfernandez.net/api/users/1';
const response = doRequest(url);
// Store in cache.
storage.setItem(url, response);

//...
//...
//...

// Retrieve data:
const data = storage.getItem(url);
console.log(data); // { firstname : 'Homer', lastname : 'Simpson' }
```

Response will be stored in `/path/to/cache/directory/05fdf4.json`.
npm package: @jf/tests
Description: OOP tests system
Author: Joaquín Fernández
Latest version: 2.0.0

# @jf/tests [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install @jf/tests](https://nodei.co/npm/@jf/tests.png?compact=true)](https://npmjs.org/package/@jf/tests/)

OOP tests system.
npm package: @jf/tpl
Description: Replace placeholders in a string with values in object. Placeholders delimiters are customizables.
Author: Joaquín Fernández
Latest version: 1.0.0

# jfTpl [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

A very simple system to replace placeholders in a string with values in object.

Sometime we need replace placeholders in translated strings but other alternatives
(mustache, handlebars, underscore, etc) are too big for our requirements.

Placeholders delimiters are customizables (default: `{}`).

## Usage

[![npm install jfTpl](https://nodei.co/npm/jf-tpl.png?compact=true)](https://npmjs.org/package/jf-tpl/)

### Options

* **context**  Context with variables to replace in template.
* **defaults** Default values for context.
* **delKeys**  If `true`, all keys found in template will be removed from context/defaults,
               depending of which object provide the key (default: `false`).
* **keep**     Preserve plaholders not replaced (default: `false`).
* **left**     Left delimiter (default: `{`).
* **right**    Right delimiter (default: `}`).
* **tpl**      Template to render.

### Examples

```js
// Displaying `Hello Guest, welcome to home` using 
// differents configurations.
const jfTpl = require('jf-tpl');
// Simple
console.log(
    jfTpl(
        {
            tpl     : 'Hello {name}, welcome to {site}',
            context : {
                name : 'Guest',
                site : 'home'
            }
        }
    )
);
// All options used.
console.log(
    jfTpl(
        {
            tpl      : 'Hello <[name]>, welcome to <[site]>',
            defaults : {
                site : 'home'
            },
            left     : '<[',
            right    : ']>',
            context  : {
                name : 'Guest'
            }
        }
    )
);
// Param keep
console.log(
    jfTpl(
        {
            tpl     : 'Hello {name}, welcome to {site}',
            context : {
                name : 'Guest'
            }
        }
    )
); // Hello Guest, welcome to
console.log(
    jfTpl(
        {
            tpl     : 'Hello {name}, welcome to {site}',
            keep    : true,
            context : {
                name : 'Guest'
            }
        }
    )
); // Hello Guest, welcome to {site}
```
npm package: @jf/translations
Description: Class for working with translations in your app.
Author: Joaquín Fernández
Latest version: 2.0.0

# jfTranslations [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Simple class for translations system.

See [here](https://github.com/smhg/gettext-parser#data-structure-of-parsed-mopo-files) for
data structure of parsed JSON translations files.

## Usage

[![npm install jfTranslations](https://nodei.co/npm/@jf/translations.png?compact=true)](https://npmjs.org/package/@jf/translations/)

### Examples

```js
// File: translations/en.ui.json
{
    "charset"      : "utf-8",
    "translations" : {
        "" : {
            "Hola {name}, bienvenido a {site}" : {
                "msgstr" : ["Hello {name}, welcome {site}"]
            }
        }
    }
}
```

```js
// You can use it as singleton 
const translations = require('@jf/translations/src/Browser').i();
// Or using new operator. 
const Translations = require('@jf/translations/src/Browser');
const translations = new Translations();
//
translations.poDir = __dirname + '/translations';
translations.addLanguage('en', 'ui');
console.log(
    translations.tr(
        'Hola {name}, bienvenido a {site}',
        {
            name : 'Guest',
            site : 'home'
        }
    )
); // Hello Guest, welcome home
```

### Plurals
```js
const count = 20;
console.log(
    translations.trn(
        count,
        'You have no items in your cart',
        'You have 1 item in your cart',
        'You have {count} items in your cart',
        {
            count : count
        }
    )
); // You have 20 items in your cart
```

### Mixing formats

You can mix `printf`-like format with context placeholders.

`printf` placeholders are replaced before context placeholders and their 
order is important. Context placeholders order is not important because
each context is merged.

```js
console.log(
    translations.tr(
        'First file `{file}` has %d bytes and second file `%s` has {size} bytes.',
        1234,                 // %d - First printf placeholder.
        'file2.js',           // %s - Second printf placeholder.
        {
            size : 4567       // {size}
        },
        {
            file : 'file1.js' // {file}
        }
    )
); // First file `file1.js` has 1234 bytes and second file `file2.js` has 4567 bytes.',
```
npm package: @jf/vue-prop-sep
Description: Add `get`, `has`, `remove` and `set` methods to Vue componentes.
Author: Joaquín Fernández
Latest version: 2.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# vue-prop-sep [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install vue-prop-sep](https://nodei.co/npm/vue-prop-sep.png?compact=true)](https://npmjs.org/package/vue-prop-sep/)

Add `get`, `has`, `remove` and `set` methods to Vue componentes.

## Usage

Using `.` as separator (by default).

```javascript
import VuePropSep from 'vue-prop-sep';
import Vue        from 'vue';

Vue.use(VuePropSep);

// Vue component
export default {
    data()
    {
        return {
            a : {
                b : 1
            }
        }
    },
    created()
    {
        console.log(this.get('a.b')); // 1
        this.set('a.b', 5);
        console.log(this.get('a.b')); // 5
    }
}
```

Changing default separator.

```javascript
import VuePropSep from 'vue-prop-sep';
import Vue        from 'vue';

Vue.use(
    VuePropSep,
    {
        separator : '/'
    }
);

// Vue component
export default {
    data()
    {
        return {
            a : {
                b : 1
            }
        }
    },
    created()
    {
        console.log(this.get('a/b')); // 1
        this.set('a/b', 5);
        console.log(this.get('a/b')); // 5
    }
}
```
npm package: @jfa/arangoose
Description: Simple ORM for ArangoDB, based on [Mongoose](https://github.com/Automattic/mongoose) and [ORMjs](https://github.com/uMaxmaxmaximus/ui-js/tree/master/server/core/orm)
Author: Jonathan Allenberg
Latest version: 0.0.103

# Arangoose

Simple ORM for ArangoDB, based on [Mongoose](https://github.com/Automattic/mongoose) and [ORMjs](https://github.com/uMaxmaxmaximus/ui-js/tree/master/server/core/orm)


static:
```
// Find Models by selector
selector = { example: 'example' } // selector as example
selector = { _id: [ ...ids ] } // selector also can contain an Array of _ids
Model.find(selector, offset = 0, limit = 100)

```

**ToDo**
- config:
  - choose whether to use 'optional' or 'reuqired' for the global schema style
  - make connections identifiable
  - build in data encryption by bcrypt for passwords, etc 
  - class ObjectIds with method equal()
  - listCollections
  - collection.remove => .drop()
  - timestamps
  - Map as schemaType
npm package: @jfa/mimameidr-server
Description: mimir
Latest version: 0.0.1
Deprecated: this package has been deprecated

# graphql-arangoose-server

Graphql Arangoose Boilerplate based on [graphql-dataloader-boilerplate](https://github.com/entria/graphql-dataloader-boilerplate) 
The difference is a simple mongoose replacement called arangoose for using arangodb instead od mongodb.
npm package: @jfabello/common-errors
Description: Common error classes for Node.js.
Author: Juan F. Abello
Latest version: 1.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Node.js Common Errors Classes

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A simple Node.js module that provides common error classes.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Common Errors Classes](#common-errors-classes)
- [Contributing](#contributing)
- [License](#license)

## Installation

You can install this module via npm:

```bash
npm install @jfabello/common-errors
```

## Usage

After installation, import the module and use the common errors classes in your application:

```javascript
const commonErrors = require("@jfabello/common-errors");

try {
	// Some code that may fail
} catch (error) {
	if (error.code === "EACCES") {
		// Handle this known error
	} else {
		// Throw the ERROR_UNKNOWN common error
		throw new commonErrors.ERROR_UNKNOWN();
	}
}
```

## Common Errors Classes

The following common errors classes are available:

| Error class     | Description   |
| --------------- | ------------- |
| `ERROR_UNKNOWN` | Unknown error |

## Contributing

Unfortunately, we are not able to accept contributions at this time.

If you find a bug in the code, please open an issue.

Thank you for your understanding.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
npm package: @jfawks/fox_tail
Description: Rails View Components built with Flowbite and Tailwind CSS
Author: James Fawks
Latest version: 0.2.0

# FoxTail
Rails View Components built with Flowbite and Tailwind CSS

## Documentation
For full documentation, visit [foxtailui.com](https://foxtailui.com).

## License

* The [heroicons](https://heroicons.com/) is licensed under the [MIT License](https://opensource.org/licenses/MIT).
* The remainder of the fox_tail project is under the [MIT License](https://opensource.org/licenses/MIT).
npm package: @jfcmontmorency/dragon-smaug
Description: A minimal umd snake game.
Author: Jean-François Cartier
Latest version: 1.0.2

# Dragon Smaug (UMD bundle)

Small snake game packaged as a UMD bundle for direct inclusion in the browser.

## Usage

1. Include the UMD bundle in your page:

```html
<script src="/path/to/dist/dragon-smaug.umd.js"></script>
```

2. Mount the game on an element and start it:

```html
<div id="game"></div>
<script>
  const game = DragonSmaug.mount('#game', {
    cols: 24,
    rows: 18,
    speedMs: 110,
    onGameOver(score) { console.log('Final score:', score); }
  });
  game.start();
</script>
```

## Controls

- Arrow keys or WASD: move the snake
- R: restart after Game Over

## Example

See `example/index.html` for a small usage example.

## Auto cell sizing

If you omit the `cell` option when calling `DragonSmaug.mount(...)`, the UMD bundle will compute a sensible `cell` value automatically based on the container size and the requested `cols`/`rows`. This helps the game fit various screen sizes without manual tuning. The computed cell is clamped to a reasonable range.

## Recommended container styling

For best results it's recommended to give the mounting element some constraints so the game can scale predictably. Add a small CSS rule for the container element (here `#game`) in your page or global stylesheet. Example:

```css
#game { max-width: 95vmin; margin: 0 auto; max-height: 75vmin; }
```

This keeps the canvas from growing too large on very wide/large screens and centers it horizontally. Adjust the values to taste for your layout or replace `#game` with the selector you mount to.
npm package: @jfcode/avue
Description: A Magic Configurable Web Framework
Author: jfcode
Latest version: 3.3.5

<p align="center"><a href="https://avuejs.com" target="_blank" rel="noopener noreferrer"><img width="100" src="https://avuejs.com/images/logo-bg.jpg" alt="Avue logo"></a></p>

## 介绍
  Avue.js是基于现有的element-ui库进行的二次封装，从而简化一些繁琐的操作，核心理念为数据驱动视图,主要的组件库针对table表格和form表单场景，同时衍生出更多企业常用的组件，达到高复用，容易维护和扩展的框架，同时内置了丰富了数据展示组件，让开发变得更加容易.

### 浏览器兼容性
  支持所有符合ES5标准的浏览器(不支持IE8及以下版本）.
  
## 文件

| 文件名 | 用途 |
|-------------|----------|
| avue.min.js | 生产环境|
| avue.js     | 开发环境|

## 文档

要查看[Live Examples](https://avuejs.com/doc/installation)和文档，请访问[https://avuejs.com](https://avuejs.com).

## 问答

有关问题和支持，请使用[issues](https://gitee.com/smallweigit/avue/issues)或加入QQ群606410437.

## issues

打开问题之前，请务必提供详细的问题过程和截图，不符合准则的问题将会被拒绝.

## Changelog

[发行说明](https://gitee.com/smallweigit/avue/releases)中记录了每个版本的详细更改。

## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2017-present, jfcode
npm package: @jfdi/react-utils-for
Description: For is what loops should always have been in React.
Author: Jon Silver/Austin Breslin
Latest version: 1.0.1

# For
For is what loops should always have been in React. 

## Install
```terminal
npm install --save @jfdi/react-utils-for
```
## Example
```javascript
import React, { useState } from "react";
import ReactDOM from "react-dom";
import { For } from "@jfdi/react-utils-for";

const App = () => {
    const testItems = [{text: "test1"},{text: "test2"}];
    return (
        <For each={testItems}>{(item, index) => (
            <div key={`${item.text}${index}`}>{item.text}</div>
        )}</For>
    );
};
ReactDOM.render(<App />, document.getElementById("root"));
```
npm package: @jfdi/react-utils-show
Description: Show is what conditionals should always have been in React.
Author: Jon Silver/Austin Breslin
Latest version: 1.0.1

# Show
Show is what conditionals should always have been in React. 

## Install
```terminal
npm install --save @jfdi/react-utils-show
```
## Example
```javascript
import React, { useState } from "react";
import ReactDOM from "react-dom";
import { Show } from "@jfdi/react-utils-show";

const App = () => {
    const [enabled, setEnabled] = useState(false);
    return (
        <Show when={enabled}>
            {"Passed the if check"}
        </Show>
    );
};
ReactDOM.render(<App />, document.getElementById("root"));
```
npm package: @jfdi/use-computed-state
Description: A custom hook for holding complex, derived or computed state along with its source or simple state, which can even be just a timestamp for versioning a set of derived state.
Author: Jon Silver
Latest version: 0.0.3

# useComputedState

A custom hook for holding complex, derived or computed state along with its source or simple state, which can even be just a timestamp for versioning a set of derived state.

### Why?

Because I've seen so many devs get tied up in knots trying to manage the complexities of computed or derived state in React. Synchronising everything becomes a nightmare. As complexity grows, you add more and more lines of code to try to prevent all those unwanted renders or render loops. Don't do that. Use this instead.

### What's computed or derived state?

It's the bits of data you hold which are computed or derived from true state, or whose true state is actually held somewhere else. For example, a form maintains its own state, in its field values... duplicate it, and you have synchronisation problems. A backend database maintains the data you fetch from it... the only piece of true state you want to manage is probably the timestamp denoting when you last fetched that data. Updating backend data, particularly optimistically whilst immediately updating the UI, requires yet more synchronisation. This is why `useComputedState` exists.

Experienced devs normally get around this kind of problem in React by storing their computed or derived state in a `ref` using a `useRef` hook. That's exactly what this custom hook does. But it also abstracts away all the inner workings, giving you a nice clean API for doing this sort of thing as though it's just another piece of state but without the associated state update renders.

### Usage

```javascript
const { state, computedState, setState, setComputedState, notifyChange } = useComputedState({ initialState = Date.now(), initialComputedState, computeFn })
```

If all you pass to the hook is `initialComputedState`, `state` becomes a simple timestamp versioning that data.
Of course you can pass `initialState` instead, and the hook will call your `computeFn` callback to compute or derive your `computedState` whenever you call `setState`. If all you want is to notify the hook that something in your `computedState` changed, just call `notifyChange`, or you can specify how to change the `computedState` using `setComputedState`.

### Try It

Clone the repo, then...

```
pnpm i -r
pnpm start -r
```
npm package: @jfet/csp
Description: communicating sequential processes in javascript
Author: Andrea Simone Costa
Latest version: 1.0.8
Deprecated: movedo to @jfet97/cps

# @jfet/csp

A library for Communicating Sequential Processes, built on top of `async/await` and the asynchronous iterable interface.

[![npm version](https://badge.fury.io/js/%40jfet%2Fcsp.svg)](https://badge.fury.io/js/%40jfet%2Fcsp)

## Installation

This library requires `async/await` and `for-await-of` support.

```
$ npm install --save @jfet/csp
```

## Docs

You can find the documentation [here](https://jfet97.github.io/jfet-csp/).


## Example Usage

Below is a trivial example of usage, that plays on the standard ping-pong example.

```javascript
const { Channel } = require('@jfet/csp');

const timeout = ms => new Promise(resolve => setTimeout(resolve, ms));

const wiff = new Channel();
const waff = new Channel();

const createBall = () => ({ hits: 0, status: '' });

const createBat = async (inbound, outbound) => {
  while (true) {
    const ball = await inbound.take(); // wait for an incoming ball
    ball.hits++;
    ball.status = ball.status === 'wiff!' ? 'waff!' : 'wiff!';
    console.log(`🎾  Ball hit ${ball.hits} time(s), ${ball.status}`);
    await timeout(500); // assume it's going to take a bit to hit the ball
    await outbound.put(ball); // smash the ball back
  }
};

createBat(waff, wiff); // create a bat that will wiff waffs
createBat(wiff, waff); // create a bat that will waff wiffs

waff.put(createBall());
```

![ping pong](/assets/pingpong.gif?raw=true)


## Async Iteration Protocol
Channels implement the async iterable interface, so you can transform the following illustrative code:

```javascript
async function process (inbound, outbound) {
  while (true) {
    const msg = await inbound.take();
    // do stuff with msg
    await outbound.put(res);
  }
};
```

into a cleaner version, thanks to the powerful `for-await-of`:

```javascript
async function process (inbound, outbound) {
  for await(const msg of inbound) {
    // do stuff with msg
    await outbound.put(res);
  }
};
```

## Credits

Thanks to [Joe Harlow](https://twitter.com/someonedodgy) for his work on this topic. If you are unfamiliar with CSP, I encourage you to see [his talk](https://pusher.com/sessions/meetup/the-js-roundabout/csp-in-js) where he describe a simpler version of this library as well.

## Contributions

Contributions are welcomed and appreciated!

1. Fork this repository.
2. Make your changes, documenting your new code with comments.
3. Submit a pull request with a sane commit message.

Feel free to get in touch if you have any questions.

## License

Please see the `LICENSE` file for more information.