Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malexion/iterate-js
https://github.com/malexion/iterate-js
iterate-js npm-package
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/malexion/iterate-js
- Owner: Malexion
- License: isc
- Created: 2016-06-20T21:13:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-26T01:51:59.000Z (over 7 years ago)
- Last Synced: 2024-10-13T02:46:25.201Z (2 months ago)
- Topics: iterate-js, npm-package
- Language: JavaScript
- Size: 162 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iterate-js
## Description
Adds onto the iterate-js-lite base model, __.flow and the __.render.[...] section, along with many new built in classes inside __.lib.
Mostly experimental functions/classes ill suited for lite will stay in here.
## Wiki
[Check out the wiki.](https://github.com/Malexion/iterate-js/wiki)
## Installation
Install package with NPM and add it to your development dependencies:
`npm install iterate-js`
Around 14kb + 11kb from inheriting iterate-js-lite, uglified and minified.
## Usage
See [iterate-js-lite](https://github.com/Malexion/iterate-js-lite/wiki) for most of the base functionality.
```javascript
var __ = require('iterate-js');// Iterate over everything
__.all([ 'hello', 'world' ], function(x) { console.log(x); });
__.all({ 'hello': 1, 'world': 2 }, function(x, y) { console.log(y); });// Map array or objects
console.log(__.map([ 'hello', 'world' ], function(x) { return x; }));
// Map array or object to either or
console.log(__.map([ 'hello', 'world' ], function(x, y, z) { return { key: y, value: x }; }, { build: {} }));// Evaluate anything
console.log(__.is.string({}));
console.log(__.is.number(''));
console.log(__.is.def(null)); // Boolean eval
console.log(__.is.set(0)); // Check for null, undefined and NaN
console.log(__.flow([]).def().getProperty('length').def().result); // [].length is defined// And more
__.all(__, function(x, y) { console.log(y); });
```