
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
parse-xsd-duration
Advanced tools
Parse XSD durations to seconds (by default) or to object
$ npm install parse-xsd-duration
This package has zero dependencies and is provided in UMD format so you can easily use it in the browser.
import pxd from 'parse-xsd-duration'
pxd('PT2M10S')
// => 130
pxd('P2Y6M5DT12H35M30S')
// => 79317330
pxd('P1Y2M3DT5H20M30.123S')
// => 37070430.123
pxd('PT2M10S', true)
// => { years: 0, months: 0, days: 0, hours: 0, minutes: 2, seconds: 10, isNegative: 0 }
pxd('P2Y6M5DT12H35M30S', true)
// => { years: 2, months: 6, days: 5, hours: 12, minutes: 35, seconds: 30, isNegative: 0 }
pxd('P1Y2M3DT5H20M30.123S', true)
// => { years: 1, months: 2, days: 3, hours: 5, minutes: 20, seconds: 30.123, isNegative: 0 }
parseXsdDuration(xsdDuration: string, toObject: boolean): number | object | null
toObject
= true
.null
.TypeError
.MIT © Mick Dekkers
FAQs
Parse XSD durations to seconds
The npm package parse-xsd-duration receives a total of 561 weekly downloads. As such, parse-xsd-duration popularity was classified as not popular.
We found that parse-xsd-duration 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
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.