
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This library provides timestamp and supports custom templates for its output file.
Timestamper is a Node.js library and CLI tool that provides timestamp functionality and supports custom templates for its output file. It allows you to easily add a timestamp to a JSON file or any other file format based on a template.
en, fa).You can install Timestamper globally for CLI use or locally in your project.
Install globally to use the ts command:
npm install -g @puya/ts
Install locally in your project:
npm install @puya/ts
Once installed globally, you can use the ts command in your terminal.
ts [options]
-l [locale]: The locale to use for formatting the date/time. Default is en.-o [outputfile]: The name of the output file where the result will be saved. Default is info.json.-t [template]: The path to a template file.-f [format]: The format string to use for formatting the date/time. Default is YYYYMMDDHHmm.-so: skip generating output file.-i [inline-template]: Inline template string.Add a timestamp using the default settings:
ts
Add a timestamp to a custom output file with a specific format:
ts -l en -o result.json -f YYYYMMDDHHmmss
Use a custom template file:
ts -l fa -o result.json -t template.txt
Use an inline template:
ts -l fa -o result.json -i "{ test: '{ts}' }"
Get help:
ts --help
You can also use Timestamper as a module in your Node.js projects.
Example 1.
const { Timestamper } = require('@puya/ts');
const result = Timestamper({
locale: 'en',
outputFileName: 'result.json',
template: '{ "hash": "{ts}" }',
format: 'YYYYMMDDHHmmss'
});
if (result.success) {
console.log(`Timestamp "result.json" generated successfully`);
} else {
console.error('Failed to generate timestamp:', result.err);
}
Example 2. No output
const { Timestamper } = require('@puya/ts');
const result = Timestamper({
locale: 'en',
skipOutput: true,
template: '{ "hash": "{ts}" }',
format: 'YYYYMMDDHHmmss'
});
if (result.success) {
console.log('Timestamp: ', result.data);
} else {
console.error('Failed to generate timestamp:', result.err);
}
You can pass this variables:
locale: "en", // or "fa"
outputFileName: "output.json", //file will created at current dir
templatePath: "", //template file path
format: "YYYYMMDDHHmm", //timestamp format
inlineTemplate: "", //inline template (without path)
skipOutput: false
FAQs
This library provides timestamp and supports custom templates for its output file.
We found that @puya/ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.