Skip to content

Commit 1231a8e

Browse files
authored
Add some detail to the Standard Library doc (nushell#1546)
1 parent 95ff5e0 commit 1231a8e

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

book/standard_library.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1-
# Standard library (preview)
1+
# Standard Library (Preview)
22

3-
The standard library is located on the [Git repository](https://github.com/nushell/nushell/tree/main/crates/nu-std). At the moment it is an alpha development stage. You can find more documentation there.
3+
Nushell ships with a standard library of useful commands written in native Nu. By default, the standard library is loaded into memory (but not automatically imported) when Nushell starts.
4+
5+
The standard library currently includes:
6+
7+
- Assertions
8+
- An alternative `help` system with support for completions.
9+
- Additional JSON variant formats
10+
- XML Access
11+
- Logging
12+
- And more
13+
14+
To see a complete list of the commands available in the standard library, run the following:
15+
16+
```nu
17+
use std
18+
scope commands
19+
| where name =~ '^std '
20+
| select name usage extra_usage
21+
| wrap "std-lib"
22+
```
23+
24+
In addition, `stdlib-candidate`, found in the [nu_scripts Repository](https://github.com/nushell/nu_scripts/tree/main/stdlib-candidate/std-rfc), serves as a staging ground for new commands before they are added to the standard library.
25+
26+
::: tip Note
27+
Currently, parsing of the standard library impacts Nushell startup time. New commands are not being added to the library until this is resolved.
28+
:::
29+
30+
To disable the standard library, you can start using:
31+
32+
```nu
33+
nu --no-std-lib
34+
```
35+
36+
You will not be able to import the library using `use std *`, nor use any of its commands, if it is disabled in this way.
37+
38+
::: tip Did You Know?
39+
Because the standard library is simply composed of [custom commands](./custom_commands.html) in [modules](./modules.html) and [submodules](./modules.html#submodules-and-subcommands), you can see the source for each command with the [`view source`](/commands/docs/view_source.md) command. For example, to view the source for the `ellie` command (with syntax highlighting):
40+
41+
```nu
42+
use std *
43+
view source ellie | nu-highlight
44+
:::
45+
```

0 commit comments

Comments
 (0)