/stdx.nu

extensions for `nu std`

Primary LanguageNushellGNU General Public License v3.0GPL-3.0

stdx.nu

stdx provides additional types and commands to nushell core and std

installation

using git

git clone https://github.com/1Kinoti/stdx.nu stdx.nu
cd stdx.nu
cp stdx <your desired location>

# to make it globally available, and this to your `config.nu`
use /path/to/stdx

# to make it usable without the `stdx` prefix
use /path/to/stdx *

# to use it in a script/project/library
use /path/to/stdx

features

Option

stdx provides an Option type (also called Maybe) and a number of methods associated with it like, map, is-some, bind among others

to use the Option type

use /path/to/stdx *
Option help

read more about the Option type here and/or here

Result

stdx provides an Result type and a number of methods associated with it like, map, is-ok, bind among others

read more about the Result type here, here, here and/or here

to use the Result type

use /path/to/stdx *
Result help

List

stdx extends all the available list methods with the List type that provides additional commands like List foldr, List scanl etc and makes some core list function safer by making them return an Option instead of an error if they fail, for example

[] | first       # errors
[] | List head   # returns an `Option None`

contributing

contributions are welcome!

running tests

use stdx/test; test