Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
shabdawali
Advanced tools
Readme
Amazing human-like typing effects with typo, events, dynamic speed and more
You can either install it through npm ,or download js from dist folder or directly refer to CDN.
npm i shabdawali
var shabdawali = require('shabdawali'); // this line is needed only for nodejs users
shabdawali(el, {
lines : ["sentence 1", "sentence 2"],
//other configuration
})
You can control typing speed, deleting speed, pauses etc. using the following configuration:
{
typingSpeed : 75,
dynamicPauseBeforeDelete : true,
pauseBeforeDelete : 2000,
pauseBeforeNext : 1000,
delay : 0
}
You can enable/disable effects:
{
typoEffect : false,
repeat : true,
deleteEffect : true,
dynamicPause : true,
}
You may want to play music on a piano with key press effects. Events can help you:
{
onCharChange : function(char){...};
onLineChange : function(char, lineNumber, line){...};
nextWord : function(word){...};
}
playback events:
var me = shabdavali(..),
me.on("pause", fn);
me.on("resume", fn);
Some ideas
By default Shabdawali looks for words longer than 4 letters, and randomly applies typo effects on a maximum of 1 word per sentence. Here is the configuration:
{
max : 1, // Maximum number of typos per line
minWordLength : 5, //skip words which are smaller than 5 characters
extendedRange : 3, //How long to type before correction effect
skip : 2, //how many letters from the starting of a word should be left
randomFactor : 4 //higher the value lesser the chance to pick a word for typo effect
}
You can override checkIfFitsForTypoEffect(word)
to apply your logic to check if shabdawali would apply typo effects on current word.
Currently Shabdawali shuffles the letters of a word randomly to apply typo effects. But you can change this behavior by overriding makeTypo()
.
Some ideas
When you don't want to make a sentence longer and don't want your reader to read the same sentence again-n-again, you can set replaceable: true
to delete only uncommon parts.
E.g:
"I have worked in India"
"I have worked in Japan"
"I have worked in England"
You can pause/resume the animation whenever you want:
var amit = shabdawali(..);
amit.start(3);//pause after typing 3 sentences
amit.resume(3);//pause after typing next 3 sentences
amit.pause(); //pause manually
amit.resume(); //resume previously paused typing
(function($){
$.fn.shabdawali = function(options) {
return this.each(function() {
shabdawali($(this), options);
});
};
})(jQuery);
<slate>
<h1 ref="slat"></h1>
<script>
shabdawali(this.refs.slat, this.opts);
</script>
</slate>
//-- check https://github.com/amitguptagwl/shabdawali for more detail
class Slate extends React.Component {
constructor (props) {
super(props);
}
componentDidMount () {
var props = { lines: [ "शब्दावली (shabdawali)", "It can be used as a React component as well"]
};
shabdawali(this.el, props);
}
render(){
return <span ref={(el) => { this.el = el; }}>{this.props.children}</span>;
}
}
ReactDOM.render(
<div>
<Slate />
</div>,
document.getElementById('slat')
);
FAQs
Amazing human like typping effects with typo, events, dynamic speed and more
The npm package shabdawali receives a total of 9 weekly downloads. As such, shabdawali popularity was classified as not popular.
We found that shabdawali 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.