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.
manis
Advanced tools
Readme
For build system plugins that need to fetch relative config files (like .fecsrc).
npm install manis
strip-json-comments
var Manis = require('manis');
var stripJSONComments = require('strip-json-comments');
var loader = function (text) {
return JSON.parse(stripJSONComments(text));
};
var manis = new Manis({
files: [
{
// just for example, it should be loaded as yaml in fact.
name: '.eslintrc',
get: function (json) {
return {eslint: json};
}
},
'.fecsrc',
{
name: 'package.json',
get: function (json) {
return json.fecs || {};
}
}
],
loader: loader
});
var options = manis.from('path/to/file.js');
// do something cool with options
.yml
with js-yaml
var yaml = require('js-yaml');
var Manis = require('manis');
var loader = function (text) {
return yaml.load(text);
};
var manis = new Manis('.travis.yml', {loader: loader});
var options = manis.from('path/to/file.js');
// do something cool with options
js-yaml
to load YAML and JSON content after manis@0.3.0.var Manis = require('manis');
var manis = new Manis({
files: [
'.fecsrc',
{
name: 'package.json',
get: 'fecs'
}
]
});
manis.setDefault('default/path/to/config/fecs.json');
var options = manis.from('path/to/file.js');
// do something cool with options
var Manis = require('manis');
var manis = new Manis({
files: [
'.fecsrc',
{
name: 'package.json',
get: 'fecs'
}
]
});
manis.setDefault('default/path/to/config/fecs.json');
// will find `~/.fecsrc`
manis.setUserConfig();
var options = manis.from('path/to/file.js');
// do something cool with options
var Manis = require('manis');
var map = require('map-stream');
module.exports = function MyGulpPlugin(options) {
var manis = new Manis('.fecsrc', options);
return map(function (file, cb) {
// get the options for this file specifically
var options = manis.from(file.path);
// do something cool
// send the file along
cb(null, file);
});
};
Alias for js-yaml
module.
The default loader, parse JSON or YAML content with js-yaml
.
files
, Array or string, items could be string or Object.
loader
, Function,parser for config content.
lookup
, Boolean, Find all up-level config files. default is true.
merge
, Boolean, Merge all config objects. default is true.
cache
, Boolean, Cache config files. default is true.
rootName
, String, The name of flag when enableRoot
set to true. default is 'root'.
enableRoot
, Boolean, Enable the root flag to stop lookup in up-level directory. default is false.
stopper
, Function, the predicate for stopping search. default is null.
name
, string, the file name to be searched.
loader
, Funtion, the same as options.loader above;
stopper
, Function, the predicate for stopping search.
get
, string or Function, the field name to retrieve from config object.
cache
, Boolean, Cache config files. default is true.
FAQs
Find and read your configuration files recursively
The npm package manis receives a total of 381 weekly downloads. As such, manis popularity was classified as not popular.
We found that manis 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
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.