Import and export modules
- import allows you to include and use modules held elsewhere, on your local file system or remotely.
- allows you to specify which parts of your module are accessible to users who import your module.
It adopts browser-like module resolution, meaning that file names must be
specified in full. You may not omit the file extension and there is no special
handling of index.js
.
```js, ignore import { add, multiply } from “./arithmetic.ts”;
In this case the Ramda module is referenced, including the version number. Also note a JavaScript module is imported directly into a TypeScript module, Deno has no problem handling this.
Command:
To do this just add the keyword to the beginning of the function signature as is shown below.
All functions, classes, constants and variables which need to be accessible
inside external modules must be exported. Either by prepending them with the
export
keyword or including them in an export statement at the bottom of the
file.