Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
viki-web-utils
Advanced tools
Web utilities used by the Viki web app
npm install -S viki-web-utils
For full documentation, see it the docs page or in /docs
directory.
Keeps track of the furthest point on page that user has scrolled to (in percentage). Returns most updated value everytime percentageSeen()
is called.
import Viki from 'viki-web-utils';
const tracker = new Viki.ScrollTracker();
tracker.init();
console.log('percentage of page seen', tracker.percentageSeen()) // e.g. 5
console.log('percentage of page seen rounded to granularity of 10', tracker.percentageSeenRounded(10)) // e.g. 10
Keeps track of number of tabs user has open in current session. Saves current count to user's localStorage.
import Viki from 'viki-web-utils';
const counter = new Viki.LocalStorageTabCounter();
// open 2 tabs with current session
console.log(counter.getCount()) // 2
Tracks number of times user has resized the window. Debounced at 300ms to prevent too many function calls.
import Viki from 'viki-web-utils';
const counter = new Viki.ResizeCounter(function() {
// do something, maybe fire an event
});
// resize browser window
console.log(counter.getCount()) // e.g. 1
Tests if a resource is blocked on client side. Returns a Promise on test that is passed in blocked
and resource
values.
// create checker
const checker = new BlockedResourceChecker('https://badresource.blah');
// test resource returns a Promise
checker
.test()
.then((res) => {
console.log(res.resource, res.blocked) // https://badresource.blah true
});
Install dependencies
npm install
Run tests
npm run test
Karma wil prompt you to open browser on Google Chrome. To trigger tests, modify and save any src file.
Build and publishing
npm run build
npm run build-docs // generates JSDoc documentation to /docs dir
npm publish //script automatically builds before publish
FAQs
Utils used by the Viki web app
The npm package viki-web-utils receives a total of 0 weekly downloads. As such, viki-web-utils popularity was classified as not popular.
We found that viki-web-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.