Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@namics/nitro-component-resolver
Advanced tools
A helper to resolve and parse the nitro pattern structure and meta files
The nitro component resolver looks up all pattern.json
(can be changed) files in the given nitro components directory
and provides fast and easy access to the files and their content during development and production.
npm i --save-dev @namics/nitro-component-resolver
const ComponentResolver = require('@namics/nitro-component-resolver');
const resolver = new ComponentResolver({
rootDirectory: '/example/path/components',
// Invalidate cache on file changes (can be set to false for production mode)
// Default: true
watch: true,
// Main template (please adjust if you use another template language)
// Default: '*/*/*.hbs'
mainTemplate: '*/*/*.hbs',
// Meta json which contains the component details
// used by getComponents()
// Default: '*/*/pattern.json'
patternExpression: '*/*/pattern.json',
// Wether to cache the examples
// Default and recommend value: true
cacheExamples: true,
});
resolver.getComponentTypes()
.then(function(componentTypes) {
// Returns all existing nitro component types e.g. 'atoms', 'molecules'
console.log(componentTypes);
});
resolver.getComponents()
.then(function(components) {
// Returns all nitro components and their package.json content
console.log(components);
});
resolver.getComponents('atoms')
.then(function(components) {
// Returns the nitro components of type 'atoms' and their package.json content
console.log(components);
});
resolver.getComponentExamples('a/path/to/atoms/button')
.then(function(examples) {
console.log(examples);
});
resolver.getComponentReadme('a/path/to/atoms/button')
.then(function(readme) {
console.log(readme);
});
The component resolver relies on chokidar.
Chokidar shares its internal file watcher so that only one io-watcher per file/folder is used even if multiple chokidar instances exist.
All resolved and parsed components are cached using the hot-file-cache module:
FAQs
A helper to resolve and parse the nitro pattern structure and meta files
We found that @namics/nitro-component-resolver demonstrated a not healthy version release cadence and project activity because the last version was released 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.