
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
convict-format-with-moment
Advanced tools
Formats duration
and timestamp
for convict with Moment.js.
npm install convict-format-with-moment
An example config.js
file:
const convict = require('convict');
const convict_format_with_moment = require('convict-format-with-moment');
// Add all formats
convict.addFormats(convict_format_with_moment);
// Or add only specific formats:
// convict.addFormat(convict_format_with_moment.duration);
// etc.
// Define a schema
var config = convict({
format: {
format: 'duration'
},
format: {
format: 'timestamp'
}
});
Validation done through Moment.js:
duration
- milliseconds or a human readable string (e.g. 3000, "5 days")timestamp
- Unix timestamps or date strings recognized by Moment.jsConvict will automatically coerce environmental variables from strings to their proper types when importing them. For instance, values with the format int
, nat
, port
, or Number
will become numbers after a straight forward parseInt
or parseFloat
. duration
and timestamp
are also parse and converted into numbers, though they utilize Moment.js for date parsing.
FAQs
Formats 'duration' and 'timestamp' for convict
The npm package convict-format-with-moment receives a total of 13,732 weekly downloads. As such, convict-format-with-moment popularity was classified as popular.
We found that convict-format-with-moment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.