Socket
Socket
Sign inDemoInstall

holy-stars

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 2.0.0-rc.1

bundle.js

61

package.json
{
"name": "holy-stars",
"version": "1.2.1",
"version": "2.0.0-rc.1",
"description": "Simple stars widget",
"main": "dist/holy-stars.js",
"module": "src/index.js",
"files": [
"dist/holy-stars.js",
"dist/holy-stars.css",
"src/modules",
"src/styles",
"src/index.js",
"src/root.js"
],
"scripts": {
"dev": "webpack-dev-server --mode development",
"build": "webpack --mode production",
"test": "echo \"Error: no test specified\" && exit 1"
},
"private": false,
"keywords": [

@@ -28,29 +14,24 @@ "rate",

],
"main": "index.cjs.js",
"module": "index.js",
"types": "index.d.ts",
"jsdelivr": "bundle.min.js",
"unpkg": "bundle.min.js",
"repository": "github:ihapitw/holy-stars",
"author": "ihapitw",
"repository": "github:ihapitw/holy-stars",
"license": "ISC",
"license": "MIT",
"devDependencies": {
"babel-plugin-add-module-exports": "^1.0.4",
"babel-preset-env": "^1.7.0",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
"@babel/preset-env": "^7.9.6",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.4.2",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.3",
"html-loader": "^1.0.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"prettier": "^2.0.2",
"sass-loader": "^8.0.2",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-notifier": "^1.8.0"
"@rollup/plugin-node-resolve": "^13.0.4",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^8.21.0",
"rimraf": "^3.0.2",
"rollup": "^2.56.3",
"rollup-plugin-terser": "^7.0.2",
"tsc-alias": "^1.3.9",
"typescript": "^4.7.4"
},
"publishConfig": {
"access": "public"
}
}
# Holy Stars
Simple rate widget
```
import 'holy-stars/dist/holy-stars.css' // or in your styles
import HolyStars from 'holy-stars'
### Simple rate widget
```javascript
import 'holy-stars/index.css'
import { HolyStars } from 'holy-stars'
const stars = new HolyStars({
el: document.getElementById('stars'), // required option, only HTMLElement
rate: 4.4, // required option
el: document.getElementById('stars'),
rate: 4.4,
size: 16,
primaryColor: '#FFE135',
secondColor: '#ddd',
})
// non-required option
size: 72, // width and height single star in px
primaryColor: '#FFE135', // active star color
secondColor: '#ddd' // second star color
stars.update({
rate: 4,
size: 24,
})
```
stars.value = 2.5 // change rate
```
### Custom entry template
```javascript
const renderTemplate = ({size = 12, primaryColor, secondColor}, offset = 1) => {
return `
<div class="holy-stars__entity" style="width: ${size}px; height: ${size}px">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${24 * offset} 24" width="${size * offset}" height="${size}">
<path fill="${primaryColor}" d="M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="${size}" height="${size}">
<path fill="${secondColor}" d="M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"/>
</svg>
</div>`
}
new HolyStars({
el: document.getElementById('stars'),
rate: 4.4,
}, renderTemplate)
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc