Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.