Movement is the big topic of our News.JS this week: With Glider.js content slips elegantly across the screen, with TensorSpace.js tensors can be observed in 3D and with movement at work. It’s also about simple JavaScript – in 30 seconds or on the CLI.
Welcome to the colorful JavaScript world! The ecosystem around ECMAScript, TypeScript and Co. is big and lively, there is always news. Also this week we introduce you to some exciting projects that we noticed this week. As always, the choice is purely subjective.
Glider.js: bring movement to the site
Do you still need a library for carousels as a web design element? Yes, says the developer of Glider.js, who was frustrated with the many problems he had with other solutions. So he built his own – that’s not the bad way to deal with frustration. Glider.js has a gzipped size of 2.3kb and no dependencies. Anyone who has been frustrated by carousel menus could risk a look.
Observing Tensors: The View into the Digital Brain
Machine learning is often hard to understand. You can read what tensors are or how TensorFlow works, but it’s hard to get a true picture of what happens during machine learning. A still quite new and brand new library would like to change this: TensorSpace.js was completely written in JavaScript and is currently available for download as version 0.1.1 on GitHub. The GitHub page describes TensorSpace.js as a 3D visualization framework for neural networks. The API should be similar to Keras. Already trained models from TensorFlow, Keras and TensorFlow.js can be visualized. What can then be seen: the layers, the data, the path through the digital brain and its learning process. Fascinating!
JavaScript in 30 seconds
What does the following code do?
[cc lang=”javascript”]const all = (arr, fn = Boolean) => arr.every(fn);[/cc]
According to website 30 Seconds of Code, that should be understandable in 30 seconds or less. In this case, the text to code declares
true
if the underlying function
true
for all elements in a collection and
false
if it does not. The project also offers examples. Numerous code snippets are displayed in this style, which can also be obtained as a package via npm:
[cc lang=”javascript”]# With npm
npm install 30-seconds-of-code
# With yarn
yarn add 30-seconds-of-code[/cc]
Do you understand all snippets in 30 seconds or do you need the examples?
Order pizza by CLI
And what about the code for a pizza order by CLI, is this code easy to understand in 30 seconds? Antoni Kepinski has released such an app on GitHub – actually a kind of chatbot, but without all the complicated libraries behind it. Also, the pizza order by CLI is of course not sent to the local delivery service. Nevertheless, the application also shows that it does not always have to be so complicated. The good old CLI does it too. This project can be obtained via npm with the following command: $ npm install -global pizza-cli.