open-index/open-npm huggingface dataset:
npm package: 2tree
Description: Easily transform any arrays into trees.
Author: CMTV
Latest version: 1.0.3

# 2Tree

With this package you can easily transform any arrays into trees.

## Usage

You need to do three thins:

1. Create a class ("product") instances of which will be used as tree items. This call must have a `children` property.
2. Create a class that inherits `TreeMaker` and implement `rawToProduct()`, `isContainer()` and `isChild()` method.
3. Create an instance of your "maker" class and call `make()` method.

That's all!
You will get your tree in result!

## Example

Let's say we want to make a tree from the following array:

```json
[
    {
        "id": 1,
        "value": "Value 1"
    },
    {
        "id": 2,
        "value": "Value 2",
        "parent": 1
    },
    {
        "id": 3,
        "value": "Value 3"
    }
]
```

Firstly, we create a class to represent tree items:

```typescript
class MyItem
{
    id: number;
    value: string;
    children: MyItem[];
}
```

Secondly, we need to create a maker class:

```typescript
import TreeMaker from "2tree";

// ... MyItem class ...

class MyTreeMaker extends TreeMaker<any, MyItem>
{
    rawToProduct(raw: any): MyItem
    {
        let myItem = new MyItem;
            myItem.id = raw.id;
            myItem.value = raw.value;
        
        return myItem;
    }

    isContainer(raw: any)
    {
        return true;
    }

    isChild(raw: any, container: any)
    {
        return raw['parent'] === container['id'];
    }
}
```
Finally, let's make a tree:

```typescript
let maker = new MyTreeMaker;

console.log(maker.make(json));
```

## Limitation

Currenlty you can only select children consequentially.
Returning `false` in `isChild()` method will close current container.
I looking for a way select children anywhere in raw array.
npm package: 2ui-sass
Description: UI Tools: Sass
Author: ryanatk
Latest version: 0.1.0

# 2ui-sass

UI Tools, Sass

# Local Dev

To output `main.css`, and watch for changes

```
npm start
```

To generate Sassdocs, and open in a browser (no auto reload, and need to build after every change)

```
npm run sassdoc
```

# Usage

To use in your project

```
npm install --save @2ui/sass
```

## Include CSS in your Sass file

This will depend on your configuration, but something like this

```scss
@import "~@2ui/sass";
```

## Include Sass in your Sass file

If you want to use the functions in your Sass file

```scss
@import "~@2ui/sass/src/lib";
```

And you can override existing variables before importing, because variables are declared using [Sass `!default`](https://sass-lang.com/documentation/variables#default-values)
npm package: 2utf8
Description: Tranform string text to UTF-8
Author: Josep Subils
Latest version: 3.0.0

# 2UTF8

> Tranform string text or text buffer to UTF-8

### NPM URL

```
http://npmjs.com/package/2utf8
```

### GIT URL

```
https://github.com/warlock/2utf8
```

# Example:

```javascript
const toUtf8 = require('2utf8')
const request = require(request)

request('https://www.js.gl', { encoding: null }, (err, res, bodybuffer) => {
  try {
    const text = toUtf8(bodybuffer)
    console.log(text)
  } catch (error) {
    console.error(error)
  }
})
```

## License

The MIT License (MIT)
Copyright (c) 2017 Josep Subils (js@js.gl)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.