Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@stafyniaksacha/facturx
Advanced tools
Factur-X and Order-X generation library for European e-invoicing standard
Generate and extract Factur-X and Order-X invoices in TypeScript, using pdf-lib and libxmljs.
# Usage (Node.js)
npx @stafyniaksacha/facturx --help
# Usage (Bun)
bunx @stafyniaksacha/facturx --help
# Generate a Factur-X/Order-X PDF-A/3 invoice
npx @stafyniaksacha/facturx generate \
--pdf input.pdf
--xml input.xml
--output output.pdf
# Extract a Factur-X/Order-X XML from a PDF
npx @stafyniaksacha/facturx extract input.pdf > output.xml
# Check a Factur-X/Order-X XML file
npx @stafyniaksacha/facturx check input.xml \
--flavor facturx \ # autodetects the flavor if not provided
--level en16931 \ # autodetects the level if not provided
npm install @stafyniaksacha/facturx
import { readFile } from 'node:fs/promises'
import { generate, extract, check } from '@stafyniaksacha/facturx'
const pdf = await readFile('/path/to/input.pdf')
const xml = await readFile('/path/to/input.xml')
// Generate a Factur-X/Order-X PDF-A/3 invoice
const buffer = await generate({
pdf, // string, buffer or PDFDocument
xml, // string, buffer or XMLDocument
// Optional
check: true, // set to false to disable the check
flavor: 'facturx', // autodetects the flavor if not provided
level: 'en16931', // autodetects the level if not provided
language: 'en-GB',
meta: { // extracted from xml if not provided
author: 'John Doe',
title: 'John Doe',
subject: 'John Doe',
keywords: ['John', 'Doe'],
},
})
// Extract a Factur-X/Order-X XML from a PDF
const [filename, content] = await extract({
pdf, // string, buffer or PDFDocument
// Optional
check: true, // set to false to disable the check
flavor: 'facturx', // autodetects the flavor if not provided
level: 'en16931', // autodetects the level if not provided
})
// Extract a Factur-X/Order-X XML from a PDF
const valid = await check({
xml, // string, buffer or XMLDocument
// Optional
flavor: 'facturx', // autodetects the flavor if not provided
level: 'en16931', // autodetects the level if not provided
})
Based on original work of akretion/factur-x
python library by Alexis de Lattre
FAQs
Factur-X and Order-X generation library for European e-invoicing standard
The npm package @stafyniaksacha/facturx receives a total of 236 weekly downloads. As such, @stafyniaksacha/facturx popularity was classified as not popular.
We found that @stafyniaksacha/facturx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.