Snippets Collections
// file data.json

{
"localItems": {
	"items": [
      {
		"title": "Halabut",
		"type": "string",
        "status": false
		},
			{
        "title": "Taco",
		"type": "string",
        "status": true
		},
      {
        "title": "Fish",
		"type": "string",
        "status": true
		},
      {
        "title": "Pork",
		"type": "string",
        "status": false
		}
		]
	}
}




//js file must be a module
// <script src="scripts.js" defer type="module"></script>

// JS file 
import data from "./data.json" assert { type: "json" };
const {localItems} = data;
const JSONDATA = localItems['items'];

star

Sun Jul 23 2023 00:55:56 GMT+0000 (Coordinated Universal Time)

#javascript #module #json #data #import

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension