Git Product home page Git Product logo

js-move-playground's Introduction

JS MOVE PLAYGROUND

Wrapper move playground by pontem. Only support Browser environment.

Demo

imcoding.online

Install

npm i @imcoding.online/js-move-playground

Use

import { setup, openProject } from "@imcoding.online/js-move-playground";

// must setup first
await setup();

// create or open project
const demo = await openProject("demo");

// create or open module
const module = demo.openModule("math.move");
demo.setContent(module, `
module 0x01::Math {
  public fun sum(a: u64, b: u64): u64 {
      a + b
  }
}
  `);

// create or open script
let script = demo.openScript("plus.move");
demo.setContent(script, `
script {
   use 0x01::Math::sum;

   fun plus(a: u64, b: u64) {
     assert!(sum(a, b) == 15, 101);
   }
}
`);

await demo.runScript("plus(10, 5)"); // execute success

await demo.runScript("plus(8, 3)"); // throw Error

// rename file
script = demo.renameFile(script, "plus_v2.move");

// remove file
demo.removeFile(script);

// remove project
await demo.remove();

js-move-playground's People

Contributors

locfortyfour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

adusud

js-move-playground's Issues

Typos in online course

Hi there!

We are a growing community learning move. We recommend the imcoding course to eachother as its a nice first resource.

Throughout the tutorials, there are some typos. If there is some way for us to fix them for you we are happy to do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.