Socket
Socket
Sign inDemoInstall

assertf

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    assertf

assert with printf message formatting.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
35.1 kB
Created
Weekly downloads
 

Readme

Source

assertf

Node's built-in assert API augmented with message formatting printf-style.

Installation

npm install assertf

Examples

var assert = require('assertf')

var apples = 2
var bananas = 3

// message vars are automatically positioned appropriately
assert.equal(apples, bananas, 'Oops, %d does not equal %d!')
// => AssertionError: Oops, 2 does not equal 3!

// you can also supply your own substitutions
assert.equal(apples, bananas, 'We have %d bananas, but only %d apples.',
    bananas, apples)
// => AssertionError: We have 3 bananas, but only 2 apples.

License

MIT

Keywords

FAQs

Last updated on 30 Jun 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc