Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
spur-config
Advanced tools
Readme
Configuration framework to help manage complex application configurations in Node.js.
The Spur Framework is a collection of commonly used Node.JS libraries used to create common application types with shared libraries.
Visit NPMJS.org for a full list of Spur Framework libraries >>
Standalone:
$ npm install spur-config --save
With dependency injection:
$ npm install spur-ioc --save
$ npm install spur-common --save
$ npm install spur-config --save
Supports active Node versions in the LTS Schedule. (view current versions)
src/config/default.js
module.exports = function () {
return this.properties({
environment: 'default',
port: 8080
});
}
src/config/shared-deployed.js
module.exports = function () {
return this.properties({
shared: {
someProp: 123
}
});
}
src/config/development.js
(default)module.exports = function () {
this.extends('default');
return this.properties({
environment: 'default'
});
}
src/config/production.js
module.exports = function () {
// Extend multiple files
this.extends('default', 'shared-deployed');
return this.properties({
environment: 'production',
port: process.env.PORT or 9000
});
}
Standalone use
This example shows how to manually load configuration into
const spurConfig = require('spur-config');
const configDirectory = path.join(__dirname, 'src/config');
// load specific environment file
const config = SpurConfig.load(configDirectory, 'production');
// loads configuration specified in NODE_ENV environment variable
const config = SpurConfig.load(configDirectory);
With spur-ioc auto-registration
This example loads the configuration into an injector/module and makes it available as the config
dependency.
src/injector.js
const spur = require('spur-ioc');
const spurConfig = require('spur-config');
const registerConfig = require('spur-common/registerConfig');
module.exports = function () {
const ioc = spur.create('test-application');
const configDirectory = path.join(__dirname, './config');
registerConfig(ioc, configDirectory);
return ioc;
}
src/services/TestConfig.js
module.exports = function (config) {
console.log(config);
}
Please send in pull requests and they will be reviewed in a timely manner. Please review this generic guide to submitting a good pull requests. The only things we ask in addition are the following:
The majority of the settings are controlled using an EditorConfig configuration file. To use it please download a plugin for your editor of choice.
In addition we use ESLint to enforce some of the JavaScript rules. To enable on your editor, please install one of the editor plugins.
If your editor does not have ESLint integration, the test commands below will run them and fail your build.
Execute the following the install the dependencies, build and test with the following.
$ npm install
$ npm test
View the package.json
's scripts
section for a list of all the other commands.
FAQs
Configuration framework to help manage complex application configurations in Node.js.
The npm package spur-config receives a total of 46 weekly downloads. As such, spur-config popularity was classified as not popular.
We found that spur-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.