Last active
February 29, 2024 02:59
-
-
Save devyn/7f75b04549fbcfb7255b1c493974b2bb to your computer and use it in GitHub Desktop.
demos from presentation at nushell core team meeting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stream plugin | |
stream_example seq 1 10 | |
stream_example seq 1 10 | describe | |
seq 1 10 | stream_example sum | |
stream_example seq 1 10000 | stream_example sum | |
[foo bar baz] | stream_example collect | |
[foo bar baz] | stream_example collect | describe | |
# engine calls (wip) | |
seq 1 5 | stream_example for-each { $in * 2 } | |
# basic tee | |
seq 1 100 | tee { save -f numbers.txt } | math sum | |
# capture stderr tee | |
do { nu --log-level trace -c 'print 5' } | tee -e { lines | find perf | save -f perf.log.txt } | |
# see plugin protocol | |
do { nu --log-level trace -c 'seq 1 5 | stream_example for-each { $in * 2 }' } | tee -e { lines | find plugin | save -f plugin.log.txt } | |
# interleave | |
seq 1 50 | wrap a | interleave { seq 1 50 | wrap b } | |
( | |
interleave | |
{ ^find . -name '*.md' | lines | each { "md: " ++ $in } } | |
{ ^find . -name '*.toml' | lines | each { "toml: " ++ $in } } | | |
to text | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment