
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@humblejs/lib
Advanced tools
Common utils library
yarn add @humblejs/lib
Following styles must be imported for all the components
@import '@humblejs/lib/dist/css/global.scss';
@import '@humblejs/lib/dist/css/themes/default.scss';
Other available files
@humblejs/lib/dist/css/reset.scss
@humblejs/lib/dist/css/toc.scss
(table of contents)Import complete library
import lib from '@humblejs/lib';
Import specific function or module
import { logger } from '@humblejs/lib';
or you can import from direct location like:
import logger from '@humblejs/lib/dist/js/logger';
Name | Direct import |
---|---|
logger ~> { info, debug, error, warn } ,{ isLoggingEnabled } | dist/js/logger |
Analytics ~> { sendEvent, reset, pageview } | dist/js/ga |
{ generateToc, addPermaLinkToHeaders } | dist/js/toc |
{ isBrowser, isIE } | dist/js/browser |
registerScrollCallback, { isElementInViewport } | dist/js/register-scroll-callback |
addListener(elem, evt, fn), { addEventListener } | dist/js/event/add-listener |
removeListener(elem, evt, fn) | dist/js/event/remove-listener |
logger
Enable/disable console
logging. Configuration is based on localStorage
ga
Google analytics wrapper
toc
Table of contents generator
browser
Browser related utility functions
register-scroll-callback
Register callback when user scrolls the page
registerScrollCallback
takes options with callback
(fn) and scrollRefId
(element ID) so when scrollRefId
is in view (or passed the point) callback
is triggered.
e.g,
window.onload = function() {
registerScrollCallback({
scrollRefId: 'menu-bar',
callback: () => {
console.log('Just past the menu bar');
},
});
}
FAQs
Common utils library
The npm package @humblejs/lib receives a total of 3 weekly downloads. As such, @humblejs/lib popularity was classified as not popular.
We found that @humblejs/lib 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.