timestamp-webpack-plugin
v0.2.3
Published
Emits a JSON file that contains timestamps of your Webpack build
Downloads
397
Readme
Timestamp Webpack Plugin
Emits a JSON file that contains timestamps of your Webpack build
Install
npm install --save-dev timestamp-webpack-plugin
Configuration
// Add to your Webpack config file
var path = require("path");
var TimestampWebpackPlugin = require('timestamp-webpack-plugin');
module.exports = {
plugins: [new TimestampWebpackPlugin()]
};
Options
Timestamp Webpack Plugin accepts two options, path and filename
new TimestampWebpackPlugin({
path: path.join(__dirname, 'app'),
// default output is timestamp.json
filename: 'timestamp.json'
})
Output
date
- returns full dateyyyy
- year, 4 digitsyy
- year, 2 digitsd
- date (0-31)dd
- date, leading zeroM
- month (0-12)MM
- month, leading zeroMMM
- month (abbreviated)MMMM
- month (full name)w
- day of the week (1-7)ww
- day of the week, leading zerowww
- day of the week (abbreviated)wwww
- day of the week (full name)H
- 24-hour time (0-23)HH
- 24-hour time, leading zeroh
- 12-hour timehh
- 12-hour time, leading zeroa
- AM/PM designationm
- minutesmm
- minutes, leading zeros
- secondsss
- seconds, leading zerosss
- millisecondsssss
- milliseconds, leading zerotimezone
- timezone offset in minutes
Sample JSON Output
(4:44pm, Saturday 13 June 2015 EST)
{
"date": "2015-06-13T20:44:37.423Z",
"yyyy": 2015,
"yy": "15",
"d": 13,
"dd": "13",
"M": 6,
"MM":" 06",
"MMM": "Jun",
"MMMM": "June",
"w": 7,
"ww": "07",
"www": "Sat",
"wwww": "Saturday",
"H": 16,
"HH": "16",
"h": 4,
"hh": "04",
"a": "PM",
"m": 44,
"mm":"44",
"s": 37,
"ss": "37",
"sss": 423,
"ssss": "423",
"timezone": 240
}