npm i remote-json-loader --save-dev
// config.json
{
"app-config": "http://my-website.ninja/config.json",
"ui-config": "http://my-website.ninja/interface-config.json",
"package": "https://raw.githubusercontent.com/msn0/remote-json-loader/master/package.json",
"whatever": "https://my-website.ninja/whatever.json"
}
import pkg from 'remote-json?package!./config.json';
// or
const pkg = require('remote-json?package!./config.json');
console.log(pkg.name); // → remote-json-loader
MIT © Michał Jezierski