Examples on this page won’t run in the playground.

When making a big project, you don’t want to store everything in one file, or in one directory. You can break your big code into smaller pieces, store them in different files, in different locations, then import and use them in other files in your project:


Clio supports absolute imports from the root of the project. Instead of writing import statements such as import "../../../lib/xyz" you can just do import "/lib/xyz".

Clio will guess the module name based on its path. The default strategy is to get the file name, remove extensions, remove any version number, and convert kebab case to pascalCase (replace dashes). If you want to rename the module, you can do:

If you only want to import only one function from the module, you can do:

If you want to rename the imported function, you can do:

To import several functions, you can do:

You can also use indents to format your imports:

To rename multiple imports, do:

To import a function, and rest of the module in a separate namespace do:

Constants can be exported as well: