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

badgifier

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badgifier - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

test/fixtures/cobertura-coverage.xml

26

lib/insert.js
'use strict'
const fs = require('fs')
const read = require('./read')
const readline = require('readline')
const EOL = require('os').EOL
const sentinel = err => new Error(err)
const altRef = '![badgifier-istanbul-cobertura]'
module.exports = (output, badge) => {
read(output)
.then((file) => {
let transformed = file.replace(/%%badgifier-replace-here%%/g, badge)
module.exports = (output, shield) => {
let tmp = ''
readline
.createInterface({
input: fs.createReadStream(output)
})
.on('line', line => {
if (line.includes(altRef)) line = `${altRef}(${shield})`
fs.writeFile(output, transformed, 'utf8', sentinel)
tmp += `${line}${EOL}`
})
.fail(sentinel)
}
.on('close', () => {
fs.writeFile(output, tmp, 'utf8', sentinel)
})
.on('err', sentinel)
}

@@ -5,9 +5,9 @@ 'use strict'

module.exports = (params, badge) => {
module.exports = (params, shield) => {
let output = params.output
if (typeof output !== 'string') return output(badge)
if (typeof output !== 'string') return output(shield)
// virtual else
insert(output)
insert(output, shield)
}
{
"name": "badgifier",
"version": "0.1.2",
"version": "0.1.3",
"description": "Generate badges without third-parties services",

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

# Badgifier
![badge](https://img.shields.io/badge/coverage-82.14-green.svg)
![badgifier-istanbul-cobertura](https://img.shields.io/badge/coverage-82.14-green.svg)

@@ -8,2 +8,2 @@

#### Some footer
#### Some footer
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