eval
Evaluate expressions to import
This module evaluates the URL hash it receives and exports it.
Getting started
import Deno from 'https://cdn.deno.land/evil/versions/1.0.4/raw/mod.js#Deno';Developing
Built With
This JavaScript module has no dependencies.
Prerequisites
Before starting to develop you need to have the latest Deno version installed.
Setting up Dev
In order to start developing the project further git-clone this respository:
git clone git@github.com:PascalSalesch/eval.git
cd eval/
deno run ./mod.jsBy cloning this repository you’re downloading all assets hosted on github.
When deno run ./mod.js will executed the code in mod.js.
Building
This package requires no build step. If it had any dependencies these could be bundled.
deno bundle 'https://deno.land/x/evil/mod.ts' eval.bundle.jsDeploying / Publishing
The package is deployed to deno.land/x/evil. In short, a git tag must be pushed.
git tag -a $major.$minor.$patch -m "v$major.$minor.$patch"
git push origin $major.$minor.$patchVersioning
We are using SemVer for versioning in order to conform to deno.land/x requirements.
Configuration
The package evaluates either the hash or the query string.
⚠️ The redirect to the latest version will omit query parameters and hashes. Use cdn.deno.land instead.
| Value | Example | Description |
|---|---|---|
| Hash | deno.land/x/evil/mod.ts#Deno |
The module tries to evaluate Deno |
| eval parameter | deno.land/x/evil/mod.ts?eval=Deno |
The module tries to evaluate Deno |
| async parameter | deno.land/x/evil/mod.ts?async=true&eval=1+1 |
Setting async to true will await an async function |
Tests
A few small tests reside in test.js.
Style Guide
Follow the Deno Style Guide. Lint with the following command:
deno fmtLicensing
All rights reserved. MIT license.