1Kinoti / stdx.nu

extensions for `nu std`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

extensions for `nu std`

License:GNU General Public License v3.0


Languages

Language:Nushell 100.0%