https://github.com/mcjazzyfunky/archived-js-essential
Elementary javascript library
https://github.com/mcjazzyfunky/archived-js-essential
Last synced: 2 months ago
JSON representation
Elementary javascript library
- Host: GitHub
- URL: https://github.com/mcjazzyfunky/archived-js-essential
- Owner: mcjazzyfunky
- License: lgpl-3.0
- Created: 2017-01-11T05:42:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T00:41:35.000Z (over 7 years ago)
- Last Synced: 2025-02-12T13:58:24.607Z (3 months ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## js-essential
Note: This library is in alpha status. Do not use it in production yet.
"js-essential" is a small JavaScript library providing a bunch of useful classes
to make daily JavaScript programming a bit more enjoyable.
This toolkit tries to observe the YAGNI principle ("You ain't gonna need it").
Means, that new features will only be added by the author as soon as he
needs them in daily work.
So, the toolkit will start as a quite "tiny" one and will grow to a "small"
toolkit in future - it will never become a "large" toolkit, as its main
purpose is to provide only really basic functionality.
Additional non-basic functionality will be provided in other projects,
not in this one.### Current features of "js-essential"
- *Class "Seq"*:
This class allows to iterate over collections and other iterable things
in a very convenient way.
Most stream operation will work lazily, means transforming streams
does normally not result in copying the underlying data collections.
This class is quite similar to 'java.util.stream.Seqs' from the Java world,
seqs in the Clojure world, streams in Scheme and Scala or lazy lists in
Haskell (although the implementation and behavior details might be different).
Facebook provides a similar class also called "Seq" in the "Immutable.js" library
(see [here](http://facebook.github.io/immutable-js/docs/#/Seq))With Seqs you can do things like the following:
```javascript
Seq.from([1, 2, 3, 4, 5])
.takeWhile(n => n < 5)
.map(n => n * 2)
.forEach(n => console.log(n)) // will output 2, 4, 6, 8Seq.iterate([1, 1], (n1, n2) => n1 + n2) // will calculate the first
.take(7) // seven fibonacci numbers:
.toArray() // [1, 1, 2, 3, 5, 8, 13]
```- *Class "Strings":*
Utility class with some static helper functions concerning strings
(for example 'Strings.trim' or 'Strings.trimToNull' etc.).### JavaScript support
"js-essential" will support all ECMAScript 5 JavaScript engines, in particular all
modern browsers (IE >= 10) and server-side Node.### Further information
For more information please refer to the "js-essential" API documentation.
There you'll find detailed description of the available classes
and methods.
The API documentation also enables to have a direct look into main source code and
unit tests.
For each method, examples are provide to show the usage.