Home Explore Blog CI



nushell

3rd chunk of `blog/2020-07-21-nushell_0_17_0.md`
c33f198b4ca3deb134eedbfb30ef1866c2856dec7539503f0000000100001059
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

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

### `if` (sophiajt)

Ever want to run one block if a condition was true and another if the condition was false? Now you can!

```
> echo 0..5 | if $it > 3 { echo big } { echo small }
───┬───────
 0 │ small
 1 │ small
 2 │ small
 3 │ small
 4 │ big
 5 │ big
───┴───────
```

The keen observer might notice we're stealthy sneaking in more commands you might use in future scripting.

### `split chars` (sophiajt)

To more easily work with the characters in a string, you can now split the characters into separate items:

```
> echo "hello" | split chars
───┬───
 0 │ h
 1 │ e
 2 │ l
 3 │ l
 4 │ o
───┴───
```

### `move column` (andrasio)

Finally, you can now move columns in your table:

```
> ls
───┬──────────────────────────────────┬──────┬─────────┬────────────
 # │ name                             │ type │ size    │ modified
───┼──────────────────────────────────┼──────┼─────────┼────────────
 0 │ 0.bootstrap.js                   │ File │ 30.9 KB │ 1 hour ago
 1 │ 46a44c28f12d33243854.module.wasm │ File │  5.4 MB │ 1 hour ago
 2 │ bootstrap.js                     │ File │ 16.3 KB │ 1 hour ago
 3 │ index.html                       │ File │  1.4 KB │ 1 hour ago
───┴──────────────────────────────────┴──────┴─────────┴────────────

> ls | move column size --before type
───┬──────────────────────────────────┬─────────┬──────┬────────────
 # │ name                             │ size    │ type │ modified
───┼──────────────────────────────────┼─────────┼──────┼────────────
 0 │ 0.bootstrap.js                   │ 30.9 KB │ File │ 1 hour ago
 1 │ 46a44c28f12d33243854.module.wasm │  5.4 MB │ File │ 1 hour ago
 2 │ bootstrap.js                     │ 16.3 KB │ File │ 1 hour ago
 3 │ index.html                       │  1.4 KB │ File │ 1 hour ago
───┴──────────────────────────────────┴─────────┴──────┴────────────
```

## Early draft of a new website (pontaoski)

We're working on a refresh of our website. If you're interested in giving it a look, we've got an [early draft started](https://github.com/nushell/website_exploration). If you'd like to help us with the design, reach out over github or discord.

Title: Nushell 0.17.0: Expanded Command Set and Website Refresh
Summary
Nushell 0.17.0 introduces several new commands including `benchmark` for timing code blocks, `str reverse` for reversing strings, `str length` for string length calculation, `str from` for number formatting, and `math stddev` and `math variance` for statistical analysis. Additionally, an `if` command for conditional execution, `split chars` for splitting strings into individual characters, and `move column` for rearranging table columns are added. The project also announces an early draft of a new website design and invites community feedback and contributions.