Home Explore Blog CI



nushell

2nd chunk of `blog/2020-07-21-nushell_0_17_0.md`
8f741d4374305bf1bc277b102ea6d2f62ca55ac3cb8bb1c90000000100000816


_Nu, now in your browser_

As part of on-going cleanup and portability work, with 0.17 it's now possible to build Nu and target WebAssembly, allowing you to run Nu in the browser and call into it from JavaScript. This is the first (experimental!) step in building towards an interactive playground and possibly more. We're hoping to talk more about this porting process in the coming days.

If you'd like to see what we're building, [check it out](https://www.nushell.sh/demo/).

## Custom keybindings (sophiajt)

Nushell now also supports custom keybindings. To configure your keybindings, you can add a keybindings.yml file beside your config file. You can find out the location for your system using:

```
> echo $nu.keybinding-path
/home/sophia/.config/nu/keybindings.yml
```

You can base your custom file off this [example keybindings file](https://github.com/nushell/nushell/blob/main/docs/sample_config/keybindings.yml).

## New commands

### `benchmark` (pag4k)

The new `benchmark` command will time a block and output the length of time it took to run:

```
> benchmark { echo "hello" }
363us 528ns
```

### `str reverse` (JosephTLyons)

The `str reverse` command will reverse the characters of a string:

```
> echo "hello world" | str reverse
dlrow olleh
```

### `str length` (sophiajt)

On a related note, you can now also get the length of a string.

```
> echo "hello world" | str length
11
```

### `str from` (bailey-layzer)

In previous versions of Nu, it was difficult to format numbers for precision and digit grouping. Starting with 0.17, there's now a new `str from` subcommand to help with this.

```
> echo 1.456123 | str from --decimals 2
1.46

> echo 1234567 | str from --group-digits
1,234,567
```

### `math stddev` and `math variance` (amousa11)

You can now calculate standard deviation and variance in your numeric datasets:

```
> echo [ 1 2 3 4 5 ] | math stddev
1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573

Title: Nushell 0.17.0: New Features - WebAssembly, Custom Keybindings, and Commands
Summary
Nushell 0.17.0 introduces WebAssembly support, enabling Nu to run in the browser. It also includes custom keybindings, configurable via a keybindings.yml file. New commands like `benchmark`, `str reverse`, `str length`, `str from`, `math stddev`, and `math variance` have been added to enhance functionality, including timing blocks, reversing strings, getting string length, formatting numbers, and calculating statistical measures.