Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
photofinish
Advanced tools
Readme
Benchmarking library for Node.js that emphasizes convenience of use
$ npm install --save photofinish
import { BenchmarkBuilder } from 'photofinish'
expect.extend({
toBeAround(actual: number, expected: number, precision = 2) {
const pass = Math.abs(expected - actual) < Math.pow(10, -precision) / 2
if (pass) {
return {
message: () => `expected ${actual} not to be around ${expected}`,
pass: true,
}
} else {
return {
message: () => `expected ${actual} to be around ${expected}`,
pass: false,
}
}
},
})
describe('benchmarkExecutioner', () => {
describe('sync function under test', () => {
it('benchmarks sync function correctly', () => {
const testFn = () => {}
const benchmarkBuilder = new BenchmarkBuilder()
const benchmark = benchmarkBuilder
.benchmarkName('noop')
.warmupCycles(500)
.benchmarkCycles(44)
.benchmarkCycleSamples(55)
.functionUnderTest(testFn)
.build()
const benchmarkResult = benchmark.execute()
expect(benchmarkResult.meanTime).toBeInstanceOf(Measurement)
// @ts-ignore
expect(benchmarkResult.meanTime.getTimeInMilliSeconds()).toBeAround(0, 1)
})
})
describe('async function under test', () => {
it('benchmarks async function correctly', async () => {
const testAsyncFn = async () => {
return asyncDelay(100)
}
const benchmarkBuilder = new BenchmarkBuilder()
const benchmark = benchmarkBuilder
.benchmarkName('Delay 100 msecs')
.warmupCycles(2)
.benchmarkCycles(5)
.benchmarkCycleSamples(5)
.asyncFunctionUnderTest(testAsyncFn)
.build()
const benchmarkResult = await benchmark.executeAsync()
expect(benchmarkResult.meanTime).toBeInstanceOf(Measurement)
// @ts-ignore
expect(benchmarkResult.meanTime.getTimeInMilliSeconds()).toBeAround(100, 0)
})
})
})
FAQs
Benchmarking library for Node.js that emphasizes convenience of use
The npm package photofinish receives a total of 12 weekly downloads. As such, photofinish popularity was classified as not popular.
We found that photofinish 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.