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

Loads Metalsmith as well as metalsmith plugins using globbing patterns similar to `load-grunt-task`

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

metalsmith-loader

Loads Metalsmith as well as multiple metalsmith plugins using globbing patterns

Build Status Dependency Status devDependency Status Code Climate

This plugin takes reference from / works similarly to load-grunt-task, allowing you to read the dependencies/devDependencies/peerDependencies in your package.json and load metalsmith plugins that matches the provided patterns.

Usually you would have to load each plugin one by one, which is unnecessarily cumbersome.

That aside, it also gives an option to load metalsmith library itself.

Before
var Metalsmith = require('metalsmith');
var drafts = require('metalsmith-drafts');
var permalinks = require('metalsmith-permalinks');
var collections = require('metalsmith-collections');
After
require('metalsmith-loader')();

Install

Install with npm: npm install --save-dev metalsmith-loader

Simplest use case:

var config = require('metalsmith-loader')();

Metalsmith(__dirname).use(config.collections());

or if you want it global:

require('metalsmith-loader')({global: true);

Metalsmith(__dirname).use(collections());

To specify additional options:

require('metalsmith-loader')({
  core: true,
	pattern: 'metalsmith-*',
	config: '../package.json',
	scope: 'devDependencies',
	global: true
});

Options

core (optional)

Type: boolean Default: false

Determines if metalsmith should be loaded.

pattern (optional)

Type: String|Object Default: metalsmith-*

By default metalsmith-* will be used as the globbing pattern.

config (optional)

Type: String|Object
Default: Path to nearest package.json

scope (optional)

Type: String|Array
Default: ['dependencies', 'devDependencies', 'peerDependencies']

global (optional)

Type: boolean Default: false

Determines if plugin should require modules into the global variable environment or put the modules into a return object / dictionary.

  • License

Keywords

FAQs

Package last updated on 18 Feb 2015

Did you know?

Socket

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.

Install

Related posts

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