- Deno is secure by default. It executes code in a sandbox environment, disallowing runtime access to the underlying filesystem, environment variables and scripts.
- Deno ships as a single executable with no dependencies.
- Comes with built-in utilities such as a dependency inspector (deno info) and a code formatter (deno fmt).
deno.land/x is a hosting service for Deno scripts. It caches releases of open source modules stored on GitHub and serves them at one easy-to-remember domain. These modules contain small scripts that demonstrate use of Deno and its standard module.
The basic format of code URLs is
In order to use Redis with Deno you will need a Deno Redis client. In the following sections, we will demonstrate the use of an experimental implementation of a Redis client for Deno.
Visit developer.redis.com/create/rediscloud/ and create a free Redis Enterprise Cloud account. Once you complete this tutorial, you will be provided with the database endpoint URL and password. Save it for future reference.
For a limited time, use TIGER200 to get $200 credits on Redis Enterprise Cloud and try all the advanced capabilities!
The following code creates a connection to Redis using Deno:
Replace the values of hostname and port to match those of your Redis database, and add an extra password field if needed.
Deno can grab scripts from multiple sources. For example, you can provide a filename, a URL, or'-' to read the file from stdin.
When you run the script, the value of
foo should be output. You can verify this by running the monitor command: