Skip to main content
Deno 2 is finally here 🎉️
Learn more

eval

Evaluate expressions to import

This module evaluates the URL hash it receives and exports it.

  1. Getting started
  2. Developing
    1. Built With
    2. Prerequisites
    3. Setting up Dev
    4. Building
    5. Deploying / Publishing
  3. Versioning
  4. Configuration
  5. Tests
  6. Style Guide
  7. Api Reference
    1. Deno
  8. Licensing

Getting started

import Deno from 'https://cdn.deno.land/evil/versions/1.0.4/raw/mod.js#Deno';

Developing

  1. Built With
  2. Prerequisites
  3. Setting up Dev
  4. Building
  5. Deploying / Publishing

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.js

By 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.js

Deploying / 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.$patch

Versioning

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 fmt

Licensing

All rights reserved. MIT license.