Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

mkEnvironment

import { mkEnvironment } from "https://garn.io/ts/v0.0.16/environment.ts";

A low-level helper to create new Environments from NixExpressions.

function mkEnvironment(nixExpression?, setup?: NixExpression): Environment;
§
mkEnvironment(nixExpression?, setup?: NixExpression): Environment
[src]

§Parameters

§
nixExpression? optional
[src]
§
setup?: NixExpression optional
[src]
  • An optional shell script to set up the environment. This script will be run for every Check before the snippet given to Environment.check is executed.
// Create a new environment where the current working directory is available under `src`:
const myEnv = mkEnvironment(
nixRaw`pkgs.mkShell {}`,
nixStrLit`
cp -r ${nixRaw`./.`} src
cd src
`,
);

Any Checks created from this environment will first copy the source files into the Check's sandbox and then run the check script snippet:

const check = myEnv.check("! grep -ir TODO .");