
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
ghostysearch
Advanced tools
Display search examples that mimic a user typing 👻🔍
Ghosty Search is like a slideshow for your search box but instead of images you'll see rotating suggestions. Each of the suggestions look like they're being typed by another human (the "ghost"). You'll see randomised time on each simulated keystroke, higher speed deletions and even a typo here and there.
See the Codepen demo for an example using CSS and HTML.
yarn add ghostysearch
# or
npm install ghostysearch
import GhostySearch from 'ghostysearch';
new GhostySearch({
inputElement: document.querySelector('.js-ghosty'), // The search input element
suggestions: [], // An array of suggestions to cycle through
wrapElement: document.querySelector('.js-ghosty-wrap'), // Wrapping element where event classes will be added
wrapClasses: {
finished: 'is-finished',
thinking: 'is-thinking',
typing: 'is-typing',
finished: 'is-finished',
deleting: 'is-deleting',
focussed: 'is-focussed',
destroyed: 'is-destroyed',
}, // Specify the container classes added at each event. Specify only what you need.
baseSpeed: 65, // The initial speed of typing, higher == slower
randomness: 4, // Higher the number, the more random time with each keypress
pauseBefore: 1000, // Pause length before typing a suggestion
pauseAfter: 1500, // Pause length after typing the suggestion
oopsyFrequency: 0, // [0-9], higher == more, The frequency of incorrect key presses
});
8kb
minifiedTested and ready for production in all modern browsers. You can gain IE11+ support with a Object.assign polyfill (at the bottom of the page) and a CustomEvent polyfill.
Contribution is welcome or open an issue and I'll tackle it.
MIT
FAQs
Display search examples that mimic a user typing
The npm package ghostysearch receives a total of 0 weekly downloads. As such, ghostysearch popularity was classified as not popular.
We found that ghostysearch 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.