Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vue-countable
Advanced tools
Readme
Vue binding for countable.js. Provides real-time paragraph, sentence, word, and character counting.
View Demo | View on NPM | View on GitHub
# npm
npm i vue-countable
# yarn
yarn add vue-countable
Or you can include it through the browser at the bottom of your page:
<script src="https://unpkg.com/vue-countable/dist/vue-countable.min.js"></script>
Simple way to count characters, words, sentences, and paragraphs in your Vue apps.
Pass your text
as a prop to the provided component, along with a unique elementId
, and register for the change
event to get real-time count updates.
import VueCountable from 'vue-countable'
Vue.component('vue-countable', VueCountable)
<!-- In your html - Make sure the elementId prop is unique on your page. -->
<vue-countable
:text="myText" // Your text variable
:elementId="'myId'" // A unique string id
@change="change" // Register for the change event
></vue-countable>
<!-- The @change function -->
change (event) {
console.log(event)
// event.words to get word count, etc.
}
Now, anytime (and on component initialization) your myText
variable changes, vue-countable
will emit an event containing the details of your text. Register for this event as shown above to get your real-time counts.
prop | type | description |
---|---|---|
text | String | Text you want to track. |
elementId | String | A unique id for your tracking instance. This allows you to have multiple different counts on the same page. |
hardReturns | Boolean (Optional, defaults to false) | Require two returns to count paragraphs |
stripTags | Boolean (Optional, defaults to false) | Remove HTML before counting |
ignore | Array of Strings (Optional, defaults to empty) | Characters to be ignored. |
event | value | description |
---|---|---|
change | Object | Provides character , word , sentence , paragraph , and all values. |
# install dependencies
npm install
# serve with hot reload
npm run watch
# run the tests
npm run test
# build demo page
npm run build:example
# build library
npm run build:library
# build everything and run tests
npm run build
Go ahead and fork the project! Submit an issue if needed. Have fun!
Sacha Schmid for countable.js.
Packaged with a mixture of vue-lib-template and vue-sfc-rollup. Using webpack 4.
FAQs
Vue binding for countable.js. Provides real-time paragraph, sentence, word, and character counting.
The npm package vue-countable receives a total of 226 weekly downloads. As such, vue-countable popularity was classified as not popular.
We found that vue-countable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.