Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@pascholda1/vue-runtime-config-plugin
Advanced tools
A VueJS plugin to read JSON config files per environment at runtime.
A VueJS plugin to read JSON config files per environment at runtime.
Works with Vue2. Vue3 support coming soon.
npm i @pascholda1/vue-runtime-config-plugin
import Vue from 'vue';
import vueRuntimeConfigPlugin from '@pascholda1/vue-runtime-config-plugin';
Vue.use(vueRuntimeConfigPlugin)
(async () => {
// fetch the config files from /config
const config = await vueRuntimeConfigPlugin.loadEnvironment({
environment: process.env.NODE_ENV
});
console.log(config)
// init App
new Vue({
render: h => h(App),
}).$mount('#app');
})
import Vue from 'vue';
import {VueRuntimeConfigPlugin} from '@pascholda1/vue-runtime-config-plugin';
const vueRuntimeConfigPlugin = new VueRuntimeConfigPlugin({
configPath: "/my/config/path",
staticConfig: process.env
})
Vue.use(vueRuntimeConfigPlugin)
(async () => {
// fetch the config files from /my/config/path
const config = await vueRuntimeConfigPlugin.loadEnvironment({
environment: process.env.NODE_ENV,
forceFetch: true
});
console.log(config)
// init App
new Vue({
render: h => h(App),
}).$mount('#app');
})
<template>
<div id="app">
<pre>{{ $config }}</pre>
</div>
</template>
<script>
export default {
name: 'App',
created() {
console.log(this.$config)
},
methods: {
async switchConfigEnvironment(environment) {
await this.$vueRuntimeConfigPlugin.loadEnvironment({
environment
});
// Note that the $config object is NOT reactive
await this.$forceUpdate()
}
}
};
</script>
Your config directory should contain min. two Files. The default.config.json
and the one for each environment
eg. development.config.json
the environment config will be merged into the default config which will be merged into the static config which was passed to the constructor.
If you use nested configurations in your file the plugin will overwrite the whole first level Object.
FAQs
A VueJS plugin to read JSON config files per environment at runtime.
The npm package @pascholda1/vue-runtime-config-plugin receives a total of 1 weekly downloads. As such, @pascholda1/vue-runtime-config-plugin popularity was classified as not popular.
We found that @pascholda1/vue-runtime-config-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.