![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
common-middleware-fix
Advanced tools
Common middleware for applications built with base-methods (like assemble, verb, generate, and update)
Common middleware for applications built with base-methods (like assemble, verb, generate, and update)
Install with npm:
$ npm install --save common-middleware
var middleware = require('common-middleware');
var assemble = require('assemble-core');
// create your app
var app = assemble();
// register the middleware
app.use(middleware());
The following middleware are included.
Parses front-matter on files that match options.extRegex
and
adds the resulting data object to file.data
. This object is
passed as context to the template engine at render time.
Registers a .preWrite
middleware for unescaping escaped delimiters.
Uses C-style macros to escape templates with {%%= foo %}
or
<%= foo %>
syntax, so they will not be evaluated by a template
engine when .render
is called.
Adds a json
property to the file
object when the file extension
matches options.jsonRegex
. This allows JSON files to be updated
by other middleware or pipeline plugins without having to parse and
stringify with each modification.
If file.contents
has not already been updated directly, the file.contents
property
is updated with stringified JSON before writing the file back to the file
system.
Customize the regex used for matching JSON files.
Example
app.use(middleware({jsonRegex: /\.json$/}));
Customize the regex used for matching template file extensions.
Example
app.use(middleware({jsonRegex: /\.(hbs|tmpl)$/}));
Customize the regex used for matching the extensions of files with templates to escape.
Example
app.use(middleware({jsonRegex: /\.(tmpl|hbs)$/}));
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on July 16, 2017.
FAQs
Common middleware for applications built with base-methods (like assemble, verb, generate, and update)
The npm package common-middleware-fix receives a total of 0 weekly downloads. As such, common-middleware-fix popularity was classified as not popular.
We found that common-middleware-fix 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.