//As of node v0.5.x yes you can require your JSON just as you would require a js file.
var someObject = require('./somefile.json')
//這樣somObject就是object形式了
//In ES6:
import someObject from ('./somefile.json')
Last active
July 29, 2022 17:25
-
-
Save veritymissed/eb9093e391f94d5d1ef3d467049ccba8 to your computer and use it in GitHub Desktop.
在JS/Nodejs檔案內require/import JSON檔/物件
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
讚喔