{"id":21951358,"url":"https://github.com/hiswe/json-import","last_synced_at":"2026-04-12T21:45:44.219Z","repository":{"id":45164162,"uuid":"149230242","full_name":"Hiswe/json-import","owner":"Hiswe","description":"a test of how we can import JSON in september 2018","archived":false,"fork":false,"pushed_at":"2022-01-04T11:39:31.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T22:33:05.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hiswe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T04:44:08.000Z","updated_at":"2020-04-15T15:46:44.000Z","dependencies_parsed_at":"2022-09-10T03:42:25.696Z","dependency_job_id":null,"html_url":"https://github.com/Hiswe/json-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fjson-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fjson-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fjson-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fjson-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hiswe","download_url":"https://codeload.github.com/Hiswe/json-import/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244999231,"owners_count":20544866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T06:13:42.208Z","updated_at":"2026-04-12T21:45:39.173Z","avatar_url":"https://github.com/Hiswe.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-import\n\na test of how we can import JSON in september 2018.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [requirements](#requirements)\n- [start](#start)\n- [tested](#tested)\n  - [fetch](#fetch)\n  - [import](#import)\n  - [using a bundler (parcel in this case)](#using-a-bundler-parcel-in-this-case)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## requirements\n\n- [node](http://nodejs.org/download/) \u003e= 8.12.0\n- [yarn](https://yarnpkg.com/lang/en/) \u003e= 1.9.4\n\n## start\n\n```\nyarn install\nyarn start\n```\n\nserver will be listening on http://127.0.0.1:8080\n\n## tested\n\n### [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)\n\n- Present in all browsers \u003e IE11. See [caniuse](https://caniuse.com/#search=fetch)\n- Replacement of XMLHttpRequest.\n- Can use a [unfetch polyfill](https://github.com/developit/unfetch)\n\n```js\nfetch('/data.json')\n  .then(response =\u003e response.json())\n  .then(json =\u003e console.log(json))\n```\n\n### [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)\n\n- Present in all browsers \u003e IE11. See [caniuse](https://caniuse.com/#search=module)\n- Can't import JSON file\n- Have to add the `type=\"module\"` attribute on the script tag\n- No [real polyfill](https://github.com/ModuleLoader/browser-es-module-loader)\n\n```js\nimport json from '/data.js'\nconsole.log(json)\n```\n\n### using a bundler ([parcel](https://parceljs.org/) in this case)\n\n- Work in all browsers\n- Can import json\n- Add a build step\n\n```js\nimport json from '../public/data.json'\nconsole.log(json)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiswe%2Fjson-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiswe%2Fjson-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiswe%2Fjson-import/lists"}