How to use the alcalzone-shared/strings.padStart function in alcalzone-shared

To help you get started, we’ve selected a few alcalzone-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AlCalzone / node-tradfri-client / maintenance / release.ts View on Github external
}
	console.log(`bumping version ${oldVersion} to specific version ${newVersion}`);
}

if (argv.dry) {
	console.log(colors.yellow("dry run:") + " not updating package files");
} else {
	console.log(`updating package.json from ${colors.blue(pack.version)} to ${colors.green(newVersion)}`);
	pack.version = newVersion;
	fs.writeFileSync(packPath, JSON.stringify(pack, null, 2));

	console.log(`updating CHANGELOG.md`);
	const d = new Date();
	changelog = changelog.replace(
		CHANGELOG_PLACEHOLDER,
		`## ${newVersion} (${d.getFullYear()}-${padStart("" + (d.getMonth() + 1), 2, "0")}-${padStart("" + d.getDate(), 2, "0")})`,
	);
	fs.writeFileSync(changelogPath, changelog, "utf8");

	// console.log(`updating io-package.json from ${colors.blue(ioPack.common.version)} to ${colors.green(newVersion)}`);
	// ioPack.common.version = newVersion;
	// fs.writeFileSync(ioPackPath, JSON.stringify(ioPack, null, 4));
}

const gitCommands = [
	`npm install`,
	`git add -A`,
	`git commit -m "release v${newVersion} [skip ci]"`,
	`git push`,
	`git tag v${newVersion}`,
	`git push origin --tags`,
];
github AlCalzone / node-tradfri-client / src / lib / conversions.ts View on Github external
	return [r, g, b].map(c => padStart(c.toString(16), 2, "0")).join("");
}
github AlCalzone / node-tradfri-client / build / lib / conversions.js View on Github external
    return [r, g, b].map(c => strings_1.padStart(c.toString(16), 2, "0")).join("");
}

alcalzone-shared

A set of utilities shared between my projects

MIT
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages