dfinity / node-motoko

Compile and run Motoko smart contracts in Node.js or the browser.
Apache License 2.0
15 stars 4 forks source link

Add convenience functions for determining canister / library entry points #19

Closed rvanasa closed 2 years ago

rvanasa commented 2 years ago
import mo from 'motoko';

mo.write('Main.mo', 'actor {}');
mo.write('Other.mo', 'actor {}');

const mainPath = mo.resolveMain(); // 'Main.mo'

mo.delete('Main.mo');

const newPath = mo.resolveMain(); // 'Other.mo'