Observed since 20 Oct, 20:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
5stars
:star::star::star::star::star:
:star::star::star::star::star:
A quickly generating 5 stars for rating based on SVG technique utility tool.
display and click modes.configuration and cli usages.display modenpx 5stars -a https://raw.githubusercontent.com/zhansingsong/5stars/master/svgs/emoji-a.svg -b https://raw.githubusercontent.com/zhansingsong/5stars/master/svgs/emoji-b.svg -o output-emoji.svg -s 20
click modenpx 5stars -a https://raw.githubusercontent.com/zhansingsong/5stars/master/svgs/emoji-a.svg -b https://raw.githubusercontent.com/zhansingsong/5stars/master/svgs/emoji-b.svg -o output-emoji-click.svg -m click -s 20
If there is the following directory structure: examples
examples
├── config.json
├── star-active.svg
└── star-normal.svg
config.json
{
"normal": "star-normal.svg",
"active": "star-active.svg",
"space": 0,
"width": "auto",
"height": "auto",
"computeSpace": true,
"mode": "display",
"output": "output.svg"
}
run the following command in current directory examples
➜ examples git:(master) ✗ npx 5stars
5stars start generating ...
complete reading star-active.svg
complete reading star-normal.svg
complete creating new symbol element star-a
complete creating new symbol element star-b
start to output output.svg
done!
output.svg
npx 5stars # use default config.json
npx 5stars -c yourConfigFile
npx 5stars --a star-normal.svg --b star-active.svg
display mode
<!-- output.svg -->
<svg class="5stars-svg" data-width="0.5" id="5stars-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 309.335 53.867">
<!-- Generator: 5stars. https://github.com/zhansingsong/5stars -->
<!-- content -->
</svg>
manipulate output.svg how to display by data-width="0.5" attribute of the output svg.
The following output is data-width="0.7":
click mode
<svg class="5stars-svg" id="5stars-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 309.335 53.867">
<!-- Generator: 5stars. https://github.com/zhansingsong/5stars -->
<!-- content -->
</svg>
If you want to control when the click operation ends, You can override window._5stars_click_cb_(n):
window._5stars_click_cb_ = function (n) {
// end click operation when returning true
return n == 5;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>5stars click mode</title>
</head>
<body>
<script>
window._5stars_click_cb_ = function (n) {
// end click operation when returning true
return n == 5;
}
</script>
<svg class="5stars-svg" id="5stars-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 269.335 53.867">
<!-- Generator: 5stars. https://github.com/zhansingsong/5stars -->
<!-- content -->
</svg>
</body>
</html>
// defaults
const config = {
// normal svg file
normal: undefined,
// active svg file
active: undefined,
// space between stars
space: 0,
// width of normal and active svg files
width: 'auto',
// height of normal and active svg files
height: 'auto',
// output path
output: './output.svg',
// if space isn't included on computing svg width.
computeSpace: false,
// generation mode: display | click
mode: 'display'
};
Usage: 5stars [options]
Options:
-v, --version output the version number
-c, --config [config] config file
-a, --normal [normal] normal svg file
-b, --active [active] active svg file
-s, --space [space] space between stars
--width [width] width of normal and active svg files
--height [height] height of normal and active svg files
-o, --output [output] output path
-m, --mode [mode] generation mode
-M, --no-compute-space if space is not included on computing svg width.
-h, --help output usage information
Examples:
$ 5stars # use default config.json
$ 5stars -c yourConfig.json
$ 5stars -a star-normal.svg -b star-active.svg
MIT.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
ajvEnvironment{
"local_name": "ajv",
"alias": false,
"peer_metadata": null
} | ^6.10.2 | runtime |
bluebirdEnvironment{
"local_name": "bluebird",
"alias": false,
"peer_metadata": null
} | ^3.7.2 | runtime |
chalkEnvironment{
"local_name": "chalk",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | runtime |
commanderEnvironment{
"local_name": "commander",
"alias": false,
"peer_metadata": null
} | ^4.0.1 | runtime |
debugEnvironment{
"local_name": "debug",
"alias": false,
"peer_metadata": null
} | ^4.1.1 | runtime |
fs-extraEnvironment{
"local_name": "fs-extra",
"alias": false,
"peer_metadata": null
} | ^8.1.0 | runtime |
jsdomEnvironment{
"local_name": "jsdom",
"alias": false,
"peer_metadata": null
} | ^15.2.1 | runtime |
requestEnvironment{
"local_name": "request",
"alias": false,
"peer_metadata": null
} | ^2.88.0 | runtime |
request-promiseEnvironment{
"local_name": "request-promise",
"alias": false,
"peer_metadata": null
} | ^4.2.5 | runtime |
svgoEnvironment{
"local_name": "svgo",
"alias": false,
"peer_metadata": null
} | ^1.3.2 | runtime |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^6.7.2 | development |
huskyEnvironment{
"local_name": "husky",
"alias": false,
"peer_metadata": null
} | ^3.1.0 | development |
lint-stagedEnvironment{
"local_name": "lint-staged",
"alias": false,
"peer_metadata": null
} | ^9.5.0 | development |
Source distribution
{
"integrity": "sha512-RldoTDHGIdTkvj2BJtpobmGiwjBj9q0UUH25wUmyPl5QCRqaj8eASkkSQ4vSX+Vd7dXKtQKz46u4e3U/k1mD/A==",
"shasum": "56ac0f26e25456056189a95523c21fa61addd8b4",
"tarball": "https://registry.npmjs.org/5stars/-/5stars-1.0.0.tgz",
"fileCount": 6,
"unpackedSize": 21779,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5l0RCRA9TVsSAnZWagAA+GsQAJL7FDXwW6q0QLRbTvjc\nOpc4xDV9lt7MXe/STrdnqrZsOpk4+foHlSZcoJCBfyItRV9qojCp6h4jVMio\nK+t4rEC4ckTWLLdRkiUW4P3FiXvq7J6E3+6NdAR0MBPifz28lBIDhypaUXu1\nl8YsaqnPuTOgTQgKcSfGwNedUQ1MCU751oiwBaWbvHR06h2tMnt8mGuPGgiM\nx2nHTdp92vVcpkQlltjHZNwYLUgIUBgjM1DWOxyh8X2IpBXK9HU4vFAwzVq0\nFmc86ZpZCEQ6kcLbCOItA//E9Llb1XFBFFnT7tURoizr6HzYP0GfIx/ZT96A\nMKhtGiIbrwEs8PB3pVWRlRDdNStH2tlbo6paT5qvXbXlRlEMe9dMcrY1Ndfn\ncJaOy0t4GI0DLQWGf0xZkVP8kSX62N+dBfhIknsoMF61ufJDbmnbHRhJkeID\nLAS1GTXw38Z1i8jl4ME1hbWfYS5H+D8ad2L/a0LjqdWp2IM5bBIwox3G81IX\nFzU1nOr5FBj0YizAgXPsgMeNTTjQA7+QSIFLJTkrOEw0Sr3NBAmWBwAqrkn9\nQ2xazKi4vRi2lXuqfcDtf/SffsoxnuDvXachfUsHT5TgAsT1DLBUmopJAz/T\n/lv6OJKpSDCH6IBlMqvx+VX0SsNfQlO3s9g6kSjOKtNpJHcJyT1Jeti6pqR4\nweP0\r\n=dep7\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQD0QKpyFdfwdwiRTjhFmc32Gjkum29yveOfAnB9HRzqSwIgWdahVKLBq94cdvCYxn6ooNwX6eoWTxoRhNJss8EIPMY="
}
]
}Observed since 20 Oct, 20:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:c27980d5e13ba5bafa50575ea927ebca3a690757efe4bd0eddf23afdfac35883