UNPKG

5.51 kBHTMLView Raw
1<!DOCTYPE html>
2<html>
3 <head>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="assets/style.css?t=a44c9e9d">
6 <link rel="stylesheet" href="http://ricostacruz.com/docpress-rsc/style.css">
7 <script src="assets/script.js?t=2bcc4b59"></script>
8 <title>Comparison with others</title>
9 <meta name="viewport" content="width=device-width">
10 <script>
11 if (false || window.location.hostname.indexOf("ricostacruz.com") === window.location.hostname.length - 15) {
12 (function(d,o,c,p,r,e,s){d['GoogleAnalyticsObject']=r;d[r]=d[r]||function(){(d[r].q=d[r].q||[]).push(arguments)},d[r].l=1*new Date();e=o.createElement(c),s=o.getElementsByTagName(c)[0];e.async=1;e.src=p;s.parentNode.insertBefore(e,s)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
13 ga('create',"UA-20473929-1",'auto')
14 }
15 </script>
16 </head>
17 <body class="-menu-visible">
18 <div class="doc-layout">
19 <div class="toggle menu-toggle js-menu-toggle"></div>
20 <div class="body page-comparison">
21 <div class="header-nav">
22 <div class="right"><a href="https://github.com/rstacruz/scour" data-title="rstacruz/scour" class="iconlink">
23 <!-- span.title Open in GitHub--><span class="icon -github"></span></a>
24 </div>
25 </div>
26 <div class="markdown-body"><h1 id="comparison">Comparison</h1>
27<h2 id="versus-lodash">Versus Lodash</h2>
28<p><a href="http://underscorejs.org/">Underscore</a> is a library of utility functions. <a href="https://lodash.com/">Lodash</a> is a more modern implementation of it.</p>
29<p>Unlike Lodash and Underscore, scour is primarily a utility to traverse deep object trees. Lodash covers many functions useful for managing objects and arrays, but very few for making immutable edits.</p>
30<p>Scour can also traverse through scopes using <a href="index.html#go">go()</a>, which allows you to manage a subtrees and navigate through it.</p>
31<p>Scour also has extensions via <a href="index.html#use">use()</a>, which allows you to navigate your data with model-like objects (<a href="extensions_example.html">example</a>).</p>
32<ul>
33<li>Features
34<ul>
35<li><strong>Lodash</strong>: includes object utilities, as well as functions, strings, and many others.</li>
36<li><strong>Scour</strong>: only utilities relevant for objects/arrays.</li>
37</ul>
38</li>
39<li>Chaining
40<ul>
41<li><strong>Lodash</strong>: supports chaining.</li>
42<li><strong>Scour</strong>: supports chaining, and scope traversal (<a href="index.html#go">go()</a>).</li>
43</ul>
44</li>
45<li>Immutable utilities
46<ul>
47<li><strong>Lodash</strong>: has a lot, but none for setting keys deep in an object tree.</li>
48<li><strong>Scour</strong>: has <a href="index.html#get">get()</a>.</li>
49</ul>
50</li>
51<li>Lazy evaluation
52<ul>
53<li><strong>Underscore</strong>: not supported.</li>
54<li><strong>Lodash</strong>: calls to <code>.map()</code>, <code>.filter()</code> (et al) can be chained and will be optimized.</li>
55<li><strong>Scour</strong>: not supported yet.</li>
56</ul>
57</li>
58<li>Size (minified and gzipped)
59<ul>
60<li><strong>Underscore</strong>: 5.7kb (as of 1.8.3)</li>
61<li><strong>Lodash</strong>: 18.4kb (as of 3.0.0)</li>
62<li><strong>Scour</strong>: 3.4kb</li>
63</ul>
64</li>
65</ul>
66<h2 id="versus-immutable.js">Versus Immutable.js</h2>
67<p><a href="http://facebook.github.io/immutable-js/">Immutable</a> is a library for dealing with data in an immutable fashion.</p>
68<p>Scour also has extensions via <a href="index.html#use">use()</a>, which allows you to navigate your data with model-like objects (<a href="extensions_example.html">example</a>).</p>
69<p>It is really hefty (like 57kb) and has a huge API surface area.</p>
70
71 </div>
72 <div class="footer-nav">
73 <div class="left"><a href="HISTORY.html"><span class="title">Changelog</span></a></div>
74 <div class="right"><a href="extensions_example.html"><span class="label">Next: </span><span class="title">Extensions example</span></a></div>
75 </div>
76 </div>
77 <div class="menu toc-menu">
78 <li class="menu-item -level-0 -parent">
79 <ul class="submenu">
80 <li class="menu-item -level-1"><a href="index.html" class="link title link-index">scour.js</a>
81 </li>
82 <li class="menu-item -level-1 -parent"><span class="title">Appendix</span>
83 <ul class="submenu">
84 <li class="menu-item -level-2"><a href="HISTORY.html" class="link title link-history">Changelog</a>
85 </li>
86 <li class="menu-item -level-2"><a href="comparison.html" class="link title -active link-comparison">Comparison with others</a>
87 <ul class="headings heading-list">
88 <li class="heading-item -depth-2"><a href="#versus-lodash" class="hlink link-versus-lodash">Versus Lodash</a>
89 </li>
90 <li class="heading-item -depth-2"><a href="#versus-immutable.js" class="hlink link-versus-immutable.js">Versus Immutable.js</a>
91 </li>
92 </ul>
93 </li>
94 <li class="menu-item -level-2"><a href="extensions_example.html" class="link title link-extensions_example">Extensions example</a>
95 </li>
96 <li class="menu-item -level-2"><a href="redux_example.html" class="link title link-redux_example">Redux example</a>
97 </li>
98 </ul>
99 </li>
100 </ul>
101 </li>
102 </div>
103 </div>
104 </body>
105</html>
\No newline at end of file