Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-loader - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.travis.yml

45

lib/index.js

@@ -39,12 +39,21 @@ var path = require('path');

// Reduce list to scope.
var names = this.options.scope.reduce(function(prev, current) {
var deps = this.pkg[current] || [];
return prev.concat(Array.isArray(deps) ? deps : Object.keys(deps));
// Module Name list
this.names = [];
}.bind(this), []);
// Reduce + Match
this.listReduce();
this.listMatch();
// Return
return (this.options.global) ? '' : this.requires;
};
/**
* Match and add into require list
*/
Plugins.prototype.listMatch = function(){
// Start the match
multimatch(names, this.match).forEach(function(key){
multimatch(this.names, this.match).forEach(function(key){

@@ -57,3 +66,2 @@ var name = this.formatName(key);

// When lazy, loads metalsmith in as well.

@@ -63,6 +71,16 @@ if (this.options.core){

this.add('Metalsmith', require(mod));
}
}
};
// Return
return (this.options.global) ? '' : this.requires;
/**
* Reducing List to the scope
*/
Plugins.prototype.listReduce = function(){
this.names = this.options.scope.reduce(function(prev, current) {
var deps = this.pkg[current] || [];
return prev.concat(Array.isArray(deps) ? deps : Object.keys(deps));
}.bind(this), []);
};

@@ -94,3 +112,2 @@

}
};

@@ -108,4 +125,6 @@

for (var i in pattern){
var regex = new RegExp(pattern[i]);
str = str.replace(regex, '');
if (pattern.hasOwnProperty(i)){
var regex = new RegExp(pattern[i]);
str = str.replace(regex, '');
}
}

@@ -112,0 +131,0 @@

{
"name": "metalsmith-loader",
"version": "0.1.0",
"version": "0.1.1",
"description": "Loads Metalsmith as well as metalsmith plugins using globbing patterns similar to `load-grunt-task`",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

# metalsmith-loader
> Loads Metalsmith as well as multiple metalsmith plugins using globbing patterns
[![Build Status](https://travis-ci.org/yeojz/metalsmith-loader.svg?branch=master)](https://travis-ci.org/yeojz/metalsmith-loader)
[![Dependency Status](https://david-dm.org/yeojz/metalsmith-loader.svg)](https://david-dm.org/yeojz/metalsmith-loader)
[![devDependency Status](https://david-dm.org/yeojz/metalsmith-loader/dev-status.svg)](https://david-dm.org/yeojz/metalsmith-loader#info=devDependencies)
[![Code Climate](https://codeclimate.com/github/yeojz/metalsmith-loader/badges/gpa.svg)](https://codeclimate.com/github/yeojz/metalsmith-loader)
This plugin takes reference from / works similarly to [`load-grunt-task`](https://npmjs.org/package/load-grunt-tasks), allowing you to read the `dependencies`/`devDependencies`/`peerDependencies` in your package.json and load [metalsmith](http://metalsmith.io) plugins that matches the provided patterns.

@@ -5,0 +10,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc