# sntls

> Essential data structures, and behaviors

Latest version **0.21.0** (published 2015-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install sntls
pnpm add sntls
yarn add sntls
bun add sntls
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.21.0 |
| Published | 2015-07-10 |
| First published | 2013-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Dan Stocker |
| Maintainers | danstocker |
| Keywords | tools, data, hash, dictionary, collection, set, list, ordered list, tree, traversal, behaviors |

## Links

- npm: https://www.npmjs.com/package/sntls
- Repository: https://github.com/danstocker/sntls
- Issues: https://github.com/danstocker/sntls/issues
- npm.io page: https://npm.io/package/sntls

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.3.0
- [troop](https://npm.io/package/troop.md) ~0.9.0
- [dessert](https://npm.io/package/dessert.md) ~0.3.2

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.21.0 (latest) — 2015-07-10
- 0.20.4 — 2015-06-13
- 0.20.3 — 2015-06-07
- 0.20.2 — 2015-06-06
- 0.20.1 — 2015-05-10
- 0.20.0 — 2015-05-10
- 0.19.1 — 2015-05-08
- 0.19.0 — 2015-02-09
- 0.18.0 — 2015-02-06
- 0.17.4 — 2014-12-16
- 0.17.3 — 2014-12-05
- 0.17.2 — 2014-12-04
- 0.17.1 — 2014-11-08
- 0.17.0 — 2014-05-31
- 0.16.5 — 2014-01-18
- … 31 more at https://npm.io/package/sntls/versions

## README

Sntls
=====

*Pronounced: "Essentials"*

A collection of general purpose classes and behaviors (class traits) such as collections, dictionaries, trees, ordered lists, etc. The purpose of **Sntls** is to turn routines performed on multitudes (of data entries or class instances) into a series of linear transformations, akin to the CQS style of jQuery. The goal of Sntls is to make such complex transformations easy to follow and modify.

[Wiki](https://github.com/danstocker/sntls/wiki)

[Reference](http://danstocker.github.io/sntls/)

[Npm package](https://www.npmjs.com/package/sntls)

Examples
--------

[JSFiddle](http://jsfiddle.net/danstocker/EmeEU/)

**Splitting multiple strings at once**

    sntls.Collection.of(String).create(['foo', 'bar'])
        .split('')
        .items // [['f', 'o', 'o'], ['b', 'a', 'r']]

**Queries**

    var whoKnowsWho = {
        "Joe": { knows: ["Al", "David", "Joan"] },
        "Al": { knows: ["Joe"] },
        "Joan": { knows: ["Joe", "Daniel", "Pam"] }
    };

    // first-degree connections of persons with names like "J..."
    sntls.Collection.create(whoKnowsWho)
        // filtering items where keys start with "J"
        .filterByPrefix('J')
        // re-interpreting as Tree
        .toTree()
        // querying 'knows' nodes
        .queryPathValuePairsAsHash('|>knows'.toQuery())
        // and interpreting results as collection of arrays
        .toCollection(sntls.Collection.of(Array))
        .join(' and ') // joining all items
        // forming sentences
        .mapValues(function (item, path) {
            return path.toPath().asArray[0] + " knows " + item;
        })
        .getValues()

        // [
        //  "Joe knows Al and David and Joan",
        //  "Joan knows Joe and Daniel and Pam"
        // ]

---
_Source: https://npm.io/package/sntls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
