New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pug-plugin-modules

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-plugin-modules - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

23

index.js
const path = require('path');
const resolve = require('resolve');
module.exports = function({
extensions,
paths,
moduleDirectory,
packageFilter
}) {
module.exports = function(options) {
return {
resolve(filename, source, options) {
return resolve.sync(filename, {
resolve(filename, source, pugOptions) {
return resolve.sync(filename, Object.assign({
basedir: path.dirname(source),
extensions: extensions || ['.pug', '.jade'],
paths,
moduleDirectory,
packageFilter: packageFilter || pkg =>
extensions: ['.pug', '.jade'],
packageFilter: pkg =>
Object.assign({}, pkg, {
main: pkg.pug || pkg.main
})
});
}, options));
}
}
}
};
};
{
"name": "pug-plugin-modules",
"version": "0.1.0",
"version": "0.2.0",
"description": "Pug plugin for resolving templates in node_modules",

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

# pug-plugin-modules
Pug plugin for resolving templates in node_modules
## Installation
```
npm install pug-plugin-modules
```
Import plugin:
```
const modulesPlugin = require('pug-plugin-modules');
```
then, in your Pug options object:
```
{
plugins: [
modulesPlugin(/*options*/)
]
}
```
## Usage
The same options as [resolve](https://github.com/substack/node-resolve) are available. PugPluginModules provides the following defaults:
* `baseDir` = directory of source file
* `extensions` = `['.pug', '.jade']`
* `packageFilter` = will first search for `"pug"` and then `"main"` in `package.json`
## License
MIT (http://www.opensource.org/licenses/mit-license.php)
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