开发者社区> 镜像站> NPM> counting-stars
counting-stars
Counting stars like you are One Republic.
Last updated 5 years ago by kchan .
MIT · Original npm · Tarball · package.json
$ cnpm install counting-stars 
SYNC missed versions from official npm registry.

Counting Stars Build Status

Counting stars like you are One Republic.

Installation

CDN: https://npmcdn.com/counting-stars

npm install counting-stars

Example

// default settings
const options = {
  chars = ['★', '☆'],
  rating = 0,
  tag = 'span',
  attrs = {}
};
// usage
import countingStars from 'counting-stars';
countingStars({
  rating: 4
});
// use your favorite chars
countingStars({
  chars: [
    '<i class="fa fa-star"></i>',   // full star
    '<i class="fa fa-star-o"></i>', // half star
  ],
  rating: 3.5
});
// wrap star with tag and give it attributes
countingStars({
  attrs: {
    'onClick': 'handleClick'
  },
  rating: 3.5
});

License

MIT © EGOIST

Current Tags

  • 0.0.2                                ...           latest (5 years ago)

4 Versions

  • 0.0.2                                ...           5 years ago
  • 0.0.12                                ...           5 years ago
  • 0.0.11                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (2)