
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
A tool to extract key-value pairs by comparing a template with an input string.
A tool to extract key-value pairs by comparing (diffing) a template with an input string.
npm install flowxo/diffex
diffex is initialised with a template, which is used as a base for the diffing.
A template is a simple string with {{placeholder}} values. These placeholders will be replaced with data when the template is applied to an input string.
You should define your template variables inside {{ and }} curly braces. Don't include any spaces inside the curlys, as this will prevent the extractor from working correctly.
For example, these template variables are ok:
{{name}}
{{first_name}}
{{last-name}}
whereas these are invalid:
{{ name }}
{{first name}}
{{ last name }}
Create the diffex object like so:
var do = diffex(template);
Once you have the diffex object, there are two methods available: placeholders() and parse(input).
.placeholders()Parses the template and outputs all found placeholders.
Example:
var diffex = require('diffex');
var template = '{{customer}} owes £{{amount}}.';
diffex(template).placeholders();
// -> ['customer', 'amount']
.parse(input)Compares the template with an input, extracting the differences and outputting as key-value pairs.
var diffex = require('diffex');
var template = '{{customer}} owes £{{amount}}.';
var input = 'Bob owes £19.'
diffex(template).parse(input);
// -> { customer: 'Bob', amount: '19' }
The core diff algorithm was implemented by Neil Fraser, originally found here. The library is reproduced here under the Apache 2.0 license.
Apache 2.0
FAQs
A tool to extract key-value pairs by comparing a template with an input string.
The npm package diffex receives a total of 2 weekly downloads. As such, diffex popularity was classified as not popular.
We found that diffex 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.