Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
shorter-js
Advanced tools
A small ES6/ES7 library with various JavaScript tools useful for creating light libraries.
A small ES6/ES7 library with various JavaScript tools useful for creating light libraries. Featured in KUTE.js, BSN and other libraries.
dist
folder, that is mainly for build consistency testing.npm install shorter-js
// import the tool you need
import {supportTransform} from 'shorter-js'
// use the tool in your ES6/ES7 sources
if (supportTransform) {
doSomeAction()
}
perspective
transform
transition
passive
event option// EXAMPLES
import {support3DTransform} from 'shorter-js'
// filter myAction to supported browsers
if (support3DTransform) {
myAction()
}
// EXAMPLES
import {addClass,removeClass,hasClass} from 'shorter-js'
// add a class
addClass(targetElement,'className')
// remove a class
removeClass(targetElement,'className')
// check for a class
if (hasClass(targetElement,'className')) {
myAction()
}
// EXAMPLES
import {on,off,one,passiveHandler} from 'shorter-js'
// attach a passive mousedown eventHandler
on(targetElement,'click',eventHandler,passiveHandler)
// detach a passive mousedown eventHandler
off(targetElement,'mouseup',eventHandler,passiveHandler)
// attach a single instance passive mousedown eventHandler
one(targetElement,'touchstart',eventHandler,passiveHandler)
transitionend
event is triggered, or execute the callback right after for legacy browserstransitionDuration
property of a transition
propertyoptions
with passive: true event
option used// EXAMPLES
import {queryElement,emulateTransitionEnd} from 'shorter-js'
// get some target
let targetElement = queryElement('.mySelectorClass');
// emulateTransitionEnd for the above
emulateTransitionEnd(targetElement,callback)
mousedown
, up: mouseup
mouseenter
and mouseleave
OR mouseover
and mouseout
touchstart
, end: touchend
, move: touchmove
, cancel: touchcancel
transitionDuration
event property supported by the client browsertransitionend
event name supported by the client browser// EXAMPLES
import {on,off,one,mouseEvents,touchEvents,passiveHandler} from 'shorter-js'
// attach a passive mousedown eventHandler
on(targetElement,mouseEvents.down,eventHandler,passiveHandler)
// detach a passive mousedown eventHandler
off(targetElement,mouseEvents.down,eventHandler,passiveHandler)
// attach a single instance passive mousedown eventHandler
one(targetElement,touchEvents.start,eventHandler,passiveHandler)
FAQs
JavaScript shorties for the modern web.
The npm package shorter-js receives a total of 1,334 weekly downloads. As such, shorter-js popularity was classified as popular.
We found that shorter-js 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.