ip-rating-check
v1.0.0
Published
Parse and compare IP ingress-protection codes (IEC 60529): decide if a device rated IPX7 survives a specific exposure.
Maintainers
Readme
ip-rating-check
Parse an IP ingress-protection code (as defined in IEC 60529) and answer the two questions people actually ask about it:
- What does IPX7 mean?
- If a speaker is IPX5, is it fine at the pool?
The library uses only the letters "IP" plus two digits. The optional supplementary letters (H, M, S, W) are not modelled.
Install
npm i ip-rating-checkUse
const { parse, covers } = require('ip-rating-check');
parse('IP67');
// {
// code: 'IP67',
// solid: 6, solidMeans: 'dust-tight',
// liquid: 7, liquidMeans: 'immersion 1m 30min'
// }
// Is an IP67 speaker fine at "IPX5" (jets from a hose)?
covers('IP67', 'IPX5'); // true
// Is an IPX4 (splashes only) speaker fine in a pool (IPX7)?
covers('IPX4', 'IPX7'); // falseThe digits, verbatim
First digit — solids: 0 none · 5 dust-protected · 6 dust-tight. Second digit — liquids: 4 splashes · 5 low-pressure jets · 7 30 min at 1 m · 8 continuous submersion.
Notes
An X in either position means "not tested" — an IPX7 device may or may not be dust-tight. A retailer should not print "IP67" on a product that was only certified IPX7.
We use this library on the product-detail pages at CairoVolt to render the ingress claims on a Soundcore speaker in a way that matches what the certificate actually says. Reference for the mapping: the summary of IEC 60529 on Wikipedia.
License
MIT.
