Janet 1.25.1-894cd0e Documentation
(Other Versions: 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 )

JPM

Index

jpm/cc/archive-c jpm/cc/compile-c jpm/cc/create-buffer-c jpm/cc/create-buffer-c-impl jpm/cc/create-executable jpm/cc/embed-name jpm/cc/entry-name jpm/cc/entry-replace jpm/cc/link-c jpm/cc/make-bin-source jpm/cc/make-define jpm/cc/make-defines jpm/cc/modpath-to-meta jpm/cc/modpath-to-static jpm/cc/out-path jpm/cgen/add-loader jpm/cgen/ir jpm/cgen/mangle jpm/cgen/print-ir jpm/commands/build jpm/commands/clean jpm/commands/configure jpm/commands/deps jpm/commands/enable-local-mode jpm/commands/help jpm/commands/install jpm/commands/jpm-debug-repl jpm/commands/list-installed jpm/commands/list-pkgs jpm/commands/list-rules jpm/commands/new-c-project jpm/commands/new-project jpm/commands/quickbin jpm/commands/set-tree jpm/commands/show-paths jpm/commands/show-rule-tree jpm/commands/test jpm/commands/update-pkgs jpm/config/builtin-configs jpm/config/config-checkers jpm/config/config-docs jpm/config/config-options jpm/config/config-parsers jpm/config/config-set jpm/config/defconf jpm/config/dyn:ar jpm/config/dyn:auto-shebang jpm/config/dyn:binpath jpm/config/dyn:build-type jpm/config/dyn:buildpath jpm/config/dyn:c++ jpm/config/dyn:c++-link jpm/config/dyn:cc jpm/config/dyn:cc-link jpm/config/dyn:cflags jpm/config/dyn:cflags-verbose jpm/config/dyn:config-file jpm/config/dyn:cppflags jpm/config/dyn:curlpath jpm/config/dyn:dest-dir jpm/config/dyn:dynamic-cflags jpm/config/dyn:dynamic-lflags jpm/config/dyn:gitpath jpm/config/dyn:headerpath jpm/config/dyn:is-msvc jpm/config/dyn:janet jpm/config/dyn:janet-cflags jpm/config/dyn:janet-lflags jpm/config/dyn:ldflags jpm/config/dyn:lflags jpm/config/dyn:libpath jpm/config/dyn:local jpm/config/dyn:manpath jpm/config/dyn:modext jpm/config/dyn:modpath jpm/config/dyn:nocolor jpm/config/dyn:offline jpm/config/dyn:optimize jpm/config/dyn:pkglist jpm/config/dyn:silent jpm/config/dyn:statext jpm/config/dyn:tarpath jpm/config/dyn:test jpm/config/dyn:tree jpm/config/dyn:update-pkgs jpm/config/dyn:use-batch-shell jpm/config/dyn:verbose jpm/config/dyn:workers jpm/config/load-config jpm/config/load-config-file jpm/config/load-default jpm/config/load-options jpm/config/opt jpm/config/read-env-variables jpm/config/save-config jpm/config/shorthand-mapping jpm/dagbuild/pdag jpm/dagbuild/pmap jpm/make-config/auto jpm/make-config/generate-config jpm/pm/bundle-install jpm/pm/curl jpm/pm/do-rule jpm/pm/download-bundle jpm/pm/download-git-bundle jpm/pm/download-tar-bundle jpm/pm/git jpm/pm/import-rules jpm/pm/load-lockfile jpm/pm/load-project-meta jpm/pm/make-jpm-env jpm/pm/make-lockfile jpm/pm/out-of-tree-config jpm/pm/post-deps jpm/pm/require-jpm jpm/pm/resolve-bundle jpm/pm/tar jpm/pm/update-git-bundle jpm/pm/update-installed jpm/rules/add-body jpm/rules/add-dep jpm/rules/add-input jpm/rules/add-output jpm/rules/add-thunk jpm/rules/build-rules jpm/rules/getrules jpm/rules/phony jpm/rules/rule jpm/rules/sh-phony jpm/rules/sh-rule jpm/rules/sh-task jpm/rules/task jpm/scaffold/scaffold-project jpm/shutil/abspath jpm/shutil/basename jpm/shutil/clear-cache jpm/shutil/clear-manifest jpm/shutil/clexe-shell jpm/shutil/copy jpm/shutil/copyfile jpm/shutil/create-dirs jpm/shutil/devnull jpm/shutil/dirname jpm/shutil/drop1-shell jpm/shutil/exec-slurp jpm/shutil/filepath-replace jpm/shutil/find-build-dir jpm/shutil/find-cache jpm/shutil/find-manifest jpm/shutil/find-manifest-dir jpm/shutil/is-win jpm/shutil/path-splitter jpm/shutil/rimraf jpm/shutil/rm jpm/shutil/shell


jpm/cc/archive-c function source
(archive-c opts target & objects)

Link object files together to make a static library.
Community Examples

jpm/cc/compile-c function source
(compile-c compiler opts src dest &opt static?)

Compile a C file into an object file.
Community Examples

jpm/cc/create-buffer-c function source
(create-buffer-c source dest name)

Inline raw byte file as a c file.
Community Examples

jpm/cc/create-buffer-c-impl function source
(create-buffer-c-impl bytes dest name)

Community Examples

jpm/cc/create-executable function source
(create-executable opts source dest no-core)

Links an image with libjanet.a (or .lib) to produce an executable. Also will try to link native modules into the final executable as well.
Community Examples

jpm/cc/embed-name function source
(embed-name path)

Rename a janet symbol for embedding.
Community Examples

jpm/cc/entry-name function source
(entry-name name)

Name of symbol that enters static compilation of a module.
Community Examples

jpm/cc/entry-replace function source
(entry-replace name)

Escape special characters in the entry-name
Community Examples

jpm/cc/link-c function source
(link-c has-cpp opts target & objects)

Link C or C++ object files together to make a native module.
Community Examples

jpm/cc/make-bin-source function source
(make-bin-source declarations lookup-into-invocations no-core)

Community Examples

jpm/cc/make-define function source
(make-define define value)

Generate strings for adding custom defines to the compiler.
Community Examples

jpm/cc/make-defines function source
(make-defines defines)

Generate many defines. Takes a dictionary of defines. If a value is true, generates -DNAME (/DNAME on windows), otherwise -DNAME=value.
Community Examples

jpm/cc/modpath-to-meta function source
(modpath-to-meta path)

Get the meta file path (.meta.janet) corresponding to a native module path (.so).
Community Examples

jpm/cc/modpath-to-static function source
(modpath-to-static path)

Get the static library (.a) path corresponding to a native module path (.so).
Community Examples

jpm/cc/out-path function source
(out-path path from-ext to-ext)

Take a source file path and convert it to an output path.
Community Examples

jpm/cgen/add-loader function source
(add-loader)

Adds the custom template loader to Janet's module/loaders and update module/paths.
Community Examples

jpm/cgen/ir macro source
(ir & body)

Macro that automatically quotes the body provided and calls (print-ir ...) on the body.
Community Examples

jpm/cgen/mangle function source
(mangle token)

Convert any sequence of bytes to a valid C identifier in a way that is unlikely to collide. `print-ir` will not mangle symbols for you.
Community Examples

jpm/cgen/print-ir function source
(print-ir ir)

Compile the CGEN IR to C and print it to (dyn :out).
Community Examples

jpm/commands/build function source
(build)

Community Examples

jpm/commands/clean function source
(clean)

Community Examples

jpm/commands/configure function source
(configure &opt path)

Setup an out-of-tree build with certain configuration options.
Community Examples

jpm/commands/deps function source
(deps)

Community Examples

jpm/commands/enable-local-mode function source
(enable-local-mode)

Modify the config to enable local development. Creates a local tree if one does not exist in ./jpm_tree/
Community Examples

jpm/commands/help function source
(help)

Community Examples

jpm/commands/install function source
(install & repo)

Community Examples

jpm/commands/jpm-debug-repl function source
(jpm-debug-repl)

Community Examples

jpm/commands/list-installed function source
(list-installed)

Community Examples

jpm/commands/list-pkgs function source
(list-pkgs &opt search)

Community Examples

jpm/commands/list-rules function source
(list-rules &opt ctx)

Community Examples

jpm/commands/new-c-project function source
(new-c-project name)

Create a new C project
Community Examples

jpm/commands/new-project function source
(new-project name)

Create a new project
Community Examples

jpm/commands/quickbin function source
(quickbin input output)

Community Examples

jpm/commands/set-tree function source
(set-tree tree)

Set the module tree for installing dependencies. This just sets the modpath binpath and manpath. Also creates the tree if it doesn't exist. However, still uses the system libraries and headers for janet.
Community Examples

jpm/commands/show-paths function source
(show-paths)

Community Examples

jpm/commands/show-rule-tree function source
(show-rule-tree &opt root depth)

Community Examples

jpm/commands/test function source
(test)

Community Examples

jpm/commands/update-pkgs function source
(update-pkgs)

Community Examples

jpm/config/builtin-configs table source
Table of all built-in options, as opposed to project deifned options.
Community Examples

jpm/config/config-checkers table source
A table of all of the dynamic config bindings to checkers (validators).
Community Examples

jpm/config/config-docs table source
Table of all of the help text for each config option.
Community Examples

jpm/config/config-options table source
A table of possible options for enum option types.
Community Examples

jpm/config/config-parsers table source
A table of all of the dynamic config bindings to parsers.
Community Examples

jpm/config/config-set table source
Listing of all config dyns.
Community Examples

jpm/config/defconf macro source
(defconf kw &opt parser docs options)

Define a function that wraps (dyn :keyword). This will allow use of dynamic bindings with static runtime checks.
Community Examples

jpm/config/dyn:ar function source
(dyn:ar &opt dflt)

Community Examples

jpm/config/dyn:auto-shebang function source
(dyn:auto-shebang &opt dflt)

Community Examples

jpm/config/dyn:binpath function source
(dyn:binpath &opt dflt)

Community Examples

jpm/config/dyn:build-type function source
(dyn:build-type &opt dflt)

Community Examples

jpm/config/dyn:buildpath function source
(dyn:buildpath &opt dflt)

Community Examples

jpm/config/dyn:c++ function source
(dyn:c++ &opt dflt)

Community Examples

jpm/config/dyn:c++-link function source
(dyn:c++-link &opt dflt)

Community Examples

jpm/config/dyn:cc function source
(dyn:cc &opt dflt)

Community Examples

jpm/config/dyn:cc-link function source
(dyn:cc-link &opt dflt)

Community Examples

jpm/config/dyn:cflags function source
(dyn:cflags &opt dflt)

Community Examples

jpm/config/dyn:cflags-verbose function source
(dyn:cflags-verbose &opt dflt)

Community Examples

jpm/config/dyn:config-file function source
(dyn:config-file &opt dflt)

Community Examples

jpm/config/dyn:cppflags function source
(dyn:cppflags &opt dflt)

Community Examples

jpm/config/dyn:curlpath function source
(dyn:curlpath &opt dflt)

Community Examples

jpm/config/dyn:dest-dir function source
(dyn:dest-dir &opt dflt)

Community Examples

jpm/config/dyn:dynamic-cflags function source
(dyn:dynamic-cflags &opt dflt)

Community Examples

jpm/config/dyn:dynamic-lflags function source
(dyn:dynamic-lflags &opt dflt)

Community Examples

jpm/config/dyn:gitpath function source
(dyn:gitpath &opt dflt)

Community Examples

jpm/config/dyn:headerpath function source
(dyn:headerpath &opt dflt)

Community Examples

jpm/config/dyn:is-msvc function source
(dyn:is-msvc &opt dflt)

Community Examples

jpm/config/dyn:janet function source
(dyn:janet &opt dflt)

Community Examples

jpm/config/dyn:janet-cflags function source
(dyn:janet-cflags &opt dflt)

Community Examples

jpm/config/dyn:janet-lflags function source
(dyn:janet-lflags &opt dflt)

Community Examples

jpm/config/dyn:ldflags function source
(dyn:ldflags &opt dflt)

Community Examples

jpm/config/dyn:lflags function source
(dyn:lflags &opt dflt)

Community Examples

jpm/config/dyn:libpath function source
(dyn:libpath &opt dflt)

Community Examples

jpm/config/dyn:local function source
(dyn:local &opt dflt)

Community Examples

jpm/config/dyn:manpath function source
(dyn:manpath &opt dflt)

Community Examples

jpm/config/dyn:modext function source
(dyn:modext &opt dflt)

Community Examples

jpm/config/dyn:modpath function source
(dyn:modpath &opt dflt)

Community Examples

jpm/config/dyn:nocolor function source
(dyn:nocolor &opt dflt)

Community Examples

jpm/config/dyn:offline function source
(dyn:offline &opt dflt)

Community Examples

jpm/config/dyn:optimize function source
(dyn:optimize &opt dflt)

Community Examples

jpm/config/dyn:pkglist function source
(dyn:pkglist &opt dflt)

Community Examples

jpm/config/dyn:silent function source
(dyn:silent &opt dflt)

Community Examples

jpm/config/dyn:statext function source
(dyn:statext &opt dflt)

Community Examples

jpm/config/dyn:tarpath function source
(dyn:tarpath &opt dflt)

Community Examples

jpm/config/dyn:test function source
(dyn:test &opt dflt)

Community Examples

jpm/config/dyn:tree function source
(dyn:tree &opt dflt)

Community Examples

jpm/config/dyn:update-pkgs function source
(dyn:update-pkgs &opt dflt)

Community Examples

jpm/config/dyn:use-batch-shell function source
(dyn:use-batch-shell &opt dflt)

Community Examples

jpm/config/dyn:verbose function source
(dyn:verbose &opt dflt)

Community Examples

jpm/config/dyn:workers function source
(dyn:workers &opt dflt)

Community Examples

jpm/config/load-config function source
(load-config settings &opt override)

Load a configuration from a table or struct.
Community Examples

jpm/config/load-config-file function source
(load-config-file path &opt override)

Load a configuration from a file. If override is set, will override already set values. Otherwise will prefer the current value over the settings from the config file.
Community Examples

jpm/config/load-default function source
(load-default &opt override)

Load the default configuration.
Community Examples

jpm/config/load-options function source
(load-options &opt path)

Load a file that contains config options that can be set. If no such file exists, then do nothing.
Community Examples

jpm/config/opt function source
(opt opts key &opt dflt)

Get an option, allowing overrides via dynamic bindings AND some default value dflt if no dynamic binding is set.
Community Examples

jpm/config/read-env-variables function source
(read-env-variables)

Read environment variables that correspond to config variables into dyns.
Community Examples

jpm/config/save-config function source
(save-config path)

Write the current configuration information to a file.
Community Examples

jpm/config/shorthand-mapping struct source
Map some single characters to long options.
Community Examples

jpm/dagbuild/pdag function source
(pdag f dag &opt n-workers)

Executes a dag by calling f on every node in the graph. Can set the number of workers for parallel execution. The graph is represented as a table mapping nodes to arrays of child nodes. Each node will only be evaluated after all children have been evaluated. Returns a table mapping each node to the result of `(f node)`.
Community Examples

jpm/dagbuild/pmap function source
(pmap f data)

Function form of `ev/gather`. If any of the sibling fibers error, all other siblings will be canceled. Returns the gathered results in an array.
Community Examples

jpm/make-config/auto function source
(auto)

Get an autodetected config.
Community Examples

jpm/make-config/generate-config function source
(generate-config &opt destdir silent as-data)

Make a pretty good configuration file for the current target. Returns a buffer with config source contents. If `destdir` is given, will generate the folders needed to create a jpm tree.
Community Examples

jpm/pm/bundle-install function source
(bundle-install bundle &opt no-deps)

Install a bundle from a git repository.
Community Examples

jpm/pm/curl function source
(curl & args)

Make a call to curl
Community Examples

jpm/pm/do-rule function source
(do-rule target)

Evaluate a given rule in a one-off manner.
Community Examples

jpm/pm/download-bundle function source
(download-bundle url bundle-type &opt tag shallow)

Download the package source (using git) to the local cache. Return the path to the downloaded or cached soure code.
Community Examples

jpm/pm/download-git-bundle function source
(download-git-bundle bundle-dir url tag shallow)

Download a git bundle from a remote respository
Community Examples

jpm/pm/download-tar-bundle function source
(download-tar-bundle bundle-dir url &opt force-gz)

Download a dependency from a tape archive. The archive should have exactly one top level directory that contains the contents of the project.
Community Examples

jpm/pm/git function source
(git & args)

Make a call to git.
Community Examples

jpm/pm/import-rules function source
(import-rules path &opt base-env)

Import another file that defines more rules. This ruleset is merged into the current ruleset.
Community Examples

jpm/pm/load-lockfile function source
(load-lockfile &opt filename)

Load packages from a lockfile.
Community Examples

jpm/pm/load-project-meta function source
(load-project-meta &opt path)

Load the metadata from a project.janet file without doing a full evaluation of the project.janet file. Returns a struct with the project metadata. Raises an error if no metadata found.
Community Examples

jpm/pm/make-jpm-env function source
(make-jpm-env &opt base-env)

Create an environment that is preloaded with jpm symbols.
Community Examples

jpm/pm/make-lockfile function source
(make-lockfile &opt filename)

Community Examples

jpm/pm/out-of-tree-config function source
(out-of-tree-config path &opt options)

Create an out of tree build configuration. This lets a user have a debug or release build, as well as other configuration on a one time basis. This works by creating a new directory with a project.janet that loads in the original project.janet file with some settings changed.
Community Examples

jpm/pm/post-deps macro source
(post-deps & body)

Run code at the top level if jpm dependencies are installed. Build code that imports dependencies should be wrapped with this macro, as project.janet needs to be able to run successfully even without dependencies installed.
Community Examples

jpm/pm/require-jpm function source
(require-jpm path &opt base-env)

Require a jpm file project file. This is different from a normal require in that code is loaded in the jpm environment.
Community Examples

jpm/pm/resolve-bundle function source
(resolve-bundle bundle)

Convert any bundle string/table to the normalized table form.
Community Examples

jpm/pm/tar function source
(tar & args)

Make a call to tar.
Community Examples

jpm/pm/update-git-bundle function source
(update-git-bundle bundle-dir tag shallow)

Fetch latest tag version from remote repository
Community Examples

jpm/pm/update-installed function source
(update-installed)

Update all previously installed packages to their latest versions.
Community Examples

jpm/rules/add-body macro source
(add-body target & body)

Add recipe code to an existing rule. This makes existing rules do more but does not modify the dependency graph.
Community Examples

jpm/rules/add-dep function source
(add-dep target dep)

Alias for `add-input`
Community Examples

jpm/rules/add-input function source
(add-input target input)

Add a dependency to an existing rule. Useful for extending phony rules or extending the dependency graph of existing rules.
Community Examples

jpm/rules/add-output function source
(add-output target output)

Add an output file to an existing rule. Rules can contain multiple outputs, but are still referred to by a main target name.
Community Examples

jpm/rules/add-thunk function source
(add-thunk target thunk)

Append a thunk to a target's recipe.
Community Examples

jpm/rules/build-rules function source
(build-rules rules targets &opt n-workers)

Given a graph of all rules, extract a work graph that will build out-of-date files.
Community Examples

jpm/rules/getrules function source
(getrules)

Community Examples

jpm/rules/phony macro source
(phony target deps & body)

Alias for `task`.
Community Examples

jpm/rules/rule macro source
(rule target deps & body)

Add a rule to the rule graph.
Community Examples

jpm/rules/sh-phony macro source
(sh-phony target deps & body)

Alias for `sh-task`.
Community Examples

jpm/rules/sh-rule macro source
(sh-rule target deps & body)

Add a rule that invokes a shell command, and fails if the command returns non-zero.
Community Examples

jpm/rules/sh-task macro source
(sh-task target deps & body)

Add a task that invokes a shell command, and fails if the command returns non-zero.
Community Examples

jpm/rules/task macro source
(task target deps & body)

Add a task rule to the rule graph. A task rule will always run if invoked (it is always considered out of date).
Community Examples

jpm/scaffold/scaffold-project function source
(scaffold-project name &opt options)

Generate a standardized project scaffold.
Community Examples

jpm/shutil/abspath function source
(abspath path)

Create an absolute path. Does not resolve . and .. (useful for generating entries in install manifest file).
Community Examples

jpm/shutil/basename function source
(basename path)

Get the filename of a path without any leading directory components.
Community Examples

jpm/shutil/clear-cache function source
(clear-cache)

Clear the global git cache.
Community Examples

jpm/shutil/clear-manifest function source
(clear-manifest)

Clear the global installation manifest.
Community Examples

jpm/shutil/clexe-shell function source
(clexe-shell & args)

Community Examples

jpm/shutil/copy function source
(copy src dest)

Copy a file or directory recursively from one location to another.
Community Examples

jpm/shutil/copyfile function source
(copyfile src dest)

Copy a file one location to another.
Community Examples

jpm/shutil/create-dirs function source
(create-dirs dest)

Create all directories needed for a file (mkdir -p).
Community Examples

jpm/shutil/devnull function source
(devnull)

Community Examples

jpm/shutil/dirname function source
(dirname path)

Get the directory of a file without the filename.
Community Examples

jpm/shutil/drop1-shell function source
(drop1-shell std args)

Variant of `shell` to play nice with cl.exe, which outputs some junk to terminal that can't be turned off.
Community Examples

jpm/shutil/exec-slurp function source
(exec-slurp & args)

Read stdout of subprocess and return it trimmed in a string.
Community Examples

jpm/shutil/filepath-replace function source
(filepath-replace repo)

Remove special characters from a string or path to make it into a path segment.
Community Examples

jpm/shutil/find-build-dir function source
(find-build-dir)

Gets the build directory to output files to.
Community Examples

jpm/shutil/find-cache function source
(find-cache)

Return the path to the global cache.
Community Examples

jpm/shutil/find-manifest function source
(find-manifest name)

Get the full path of a manifest file given a package name.
Community Examples

jpm/shutil/find-manifest-dir function source
(find-manifest-dir)

Get the path to the directory containing manifests for installed packages.
Community Examples

jpm/shutil/is-win function source
(is-win)

Check if we should assume a DOS-like shell or default to posix shell.
Community Examples

jpm/shutil/path-splitter core/peg source
split paths on / and \.
Community Examples

jpm/shutil/rimraf function source
(rimraf path)

Hard delete directory tree
Community Examples

jpm/shutil/rm function source
(rm path)

Remove a directory and all sub directories.
Community Examples

jpm/shutil/shell function source
(shell & args)

Do a shell command
Community Examples