The core
package is the official standard library for the Motoko programming language.
This replaces the original base
library, which is available here.
An official migration guide is available for upgrading projects from base
to core
.
- Install the Mops package manager
- Open a terminal in your project directory
- Run
mops add core
This adds the following dependency to your mops.toml
config file:
[dependencies]
core = "0.6.0"
PRs are welcome! Please check out the contributor guidelines for more information.
Interface design and code style guidelines for the repository can be found here.
Make sure that Node.js
>= 22.x
is installed on your system.
Run the following commands to configure your local development branch:
# First-time setup
git clone https://github.com/dfinity/motoko-core
cd motoko-core
npm ci
npx ic-mops toolchain init
Below is a quick reference for commonly-used scripts during development:
npm test # Run all tests
npm run format # Format Motoko files
npm run validate:api # Update the public API lockfile
npm run validate:docs Array # Run code snippets in `src/Array.mo`
All available scripts can be found in the project's package.json
file.
Big thanks to the following community contributors: