Janet 1.42.0-dev-7fd75f3 Documentation
(Other Versions:
1.42.0
1.41.2
1.41.1
1.40.1
1.40.0
1.39.1
1.38.0
1.37.1
1.36.0
1.35.0
1.34.0
1.31.0
1.29.1
1.28.0
1.27.0
1.26.0
1.25.1
1.24.0
1.23.0
1.22.0
1.21.0
1.20.0
1.19.0
1.18.1
1.17.1
1.16.1
1.15.0
1.13.1
1.12.2
1.11.1
1.10.1
1.9.1
1.8.1
1.7.0
1.6.0
1.5.1
1.5.0
1.4.0
1.3.1
)
Spork
Spork is a utility library for Janet. It contains a number of small modules that should be useful for general programming in Janet but do not "make the cut" for inclusion in the standard library. You can think of spork as a sort of extended standard library for Janet.
Spork also contains similar functionality to jpm for building
projects, and is preferred for new users. A program janet-pm is distributed
with spork that should be more flexible but easier to configure for new users.
Source code
https://github.com/janet-lang/spork
Install
Once you have a Janet interpreter, use that to build and install spork.
# Pick a place to install things if you don't want the default, global install.
$ export JANET_PATH=./janet_modules; mkdir -p "$JANET_PATH"
# Allow using installed scripts like janet-pm and janet-format
$ export PATH="$PATH:$JANET_PATH/bin"
# Download, build, and install
$ git clone https://github.com/janet-lang/spork.git
$ janet --install ./spork
# Make sure it worked!
$ janet -l spork -e '(os/exit)'
$ janet-pm --help
$ janet-format --helpUsage
Every binding in the spork library will be imported if you (import spork) in either a Janet source file or at a Janet REPL:
Janet 1.35.2-fda0a081 linux/x64/gcc - '(doc)' for help
repl:1:> (import spork)
@{_ @{:value <cycle 0>} spork/argparse/argparse @{:private true} spork/base64/decode @{:private true} spork/base64/encode @{:private true} spork/crc/make-variant @{:private true} spork/crc/named-variant @{:private true} spork/cron/check @{:private true} spork/cron/next-timestamp @{:private true} spork/cron/parse-cron @{:private true} ...}
repl:2:>However, it's usually more practical to only import the specific module you want using (import spork/[module]), replacing [module] as appropriate. For example:
Janet 1.35.2-fda0a081 linux/x64/gcc - '(doc)' for help
repl:1:> (import spork/netrepl)
@{_ @{:value <cycle 0>} netrepl/client @{:private true} netrepl/default-host @{:private true} netrepl/default-port @{:private true} netrepl/server @{:private true} netrepl/server-single @{:private true}}
repl:2:>