简体   繁体   中英

How do I incorporate Skulpt into my Meteor.js webapp?

Atmosphere.js lacks a Skulpt package, so I'm unsure how to proceed. If Meteor doesn't support Skulpt, is there a way to let users type and run Python code on my Meteor app (and if so, can you provide a small example of how to implement it)?

I'm currently using the Meteor-Blaze stack.

I originally tried using trinket.io. Then I learned of the same-origin policy ( https://en.wikipedia.org/wiki/Same-origin_policy ), which prevents me from grabbing what users type from the trinket or inserting my own content.

Thanks!

As Skulpt is in Javascript, there is no reason why you shouldn't be able to use it in your Meteor app. There is an npm package, so you should be able to do

npm install skulpt

and

import skulpt from 'skulpt'

in your code where you want to use it.

I haven't tried this, I just found the npm package, which is a good indication for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM