Is this possible to import a library? How?

#1

I want to use play.js on iPad for playing a JavaScript programming game called Screeps, it have an autocomplete library (https://github.com/Garethp/ScreepsAutocomplete). Could I use it in play.js? If so, how do I make it work.

0 Likes

#2

Hi Yifeo_Ding :wave:

You can define your dependencies on your project’s package.json file and then hit the Run button to fetch them although I’m not sure you could achieve what you want as I don’t have much context on what that game is.

0 Likes

#3

The package.json didn’t work, somehow after I hit “resolve” the text only appear for less than a second and disappeared (maybe it failed clone from github?)

The game doesn’t run on local. The autocomplete library is for autocomplete during editing.

The package.json:

{
  "name": "Test",
  "version": "1.0.0",
  "dependencies": {
	"ScreepsAutoComplete":"https://github.com/Garethp/ScreepsAutocomplete.git"
  }
}
0 Likes