npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teamteanpm2024/doloremque-deserunt-praesentium

v1.1.5

Published

Simple and straightforward solution to get the next logical record.

Downloads

398

Maintainers

shivamkalsi2024shivamkalsi2024

Keywords

rdsclones3dynamodbpathconnectargumentspecpackage.jsonresolveupjasmineJSON-Schemarfc4122ECMAScript 6framerStreames-shim APIstarterxtermbrowserparsebufferswrapArray.prototype.findLastbluebirdwhichfunctionaleventsdayjsemojilintwidthwatchinginvariantmodulesenderArrayBuffer#slicebundleruuidloadbalancingObjectfscolourcallboundreact poseconcates2016getterbindbeanstalkparentaccessorstringmatchjsdiff_.extendvestefficientexit-codetakewatcherspinnersreacteslint-pluginreact-hooksreusefullesvalidateoperating-systemES3lrupreserve-symlinksmonorepoObservableArray.prototype.includesObject.fromEntriesgetReactiveExtensionsiamjsxtypesafefromswfjsonJSONdebugflagsFunction.prototype.namefastcopythroatECMAScript 2015tapexpressWeakMapimmutablenodejshandlersramdacharactersidlees2018webObject.assignmime-dbinternal slotassertionhttpsperformance__proto__parentsmimetypesmakerangeerrorbytemrupackagescirculardomoptimistglaciercorsterminallesscssStyleSheetcollection.es6jsnodetranspilercode pointsvalidhigher-orderwindowsduplexvarharmonygradients cssschemastatusFloat32Arrayratelimitexpressionfind-upconfigurableRegExp#flagspersistentquotetypedarrayswordwrapmatchesintrinsicjapaneseBigUint64Arraymetadataprotodescriptorsymbolwritablefunctionreact-testing-libraryyamlpositiveES2019Object.entrieslengthreduxdeterministicwaapi3dqueueeslintconfigjsonschemastoragegatewayomitwalkreadableconstRFC-64556to5Reflect.getPrototypeOfrm -rfpushurldirdeepcopytermcolorsfindLastIndexpasswordimportexporteventEmitterESMicrosofteslintprefixtacitmomentclassnamesttyqscloudfrontURLregexpassignjestESnextpicomatchUint8ArraybrowserlistUint8ClampedArrayRxJSchromejoifixed-widthcloudtrailsequenceebscall-boundtraversesyntaxapideep-cloneerrorObject.isfiglettranspilestablespinnerarraysreducerWebSocketscss lessscheme-validationrm -frescapecolumnsweaksetgesturesfile systemglobtypeerrorformattingdom-testing-libraryArrayBuffer.prototype.sliceworkeraccessibilitydatafetchTypedArraylinewrappipeawspuretoStringTagagenttoSortedmkdirpdeepECMAScript 2020fast-clonedragcloudformationautoprefixersyntaxerrorfunctionsWeakSetlookworkspace:*jsdomUint16Arraystreams2encryptiontrimEndfast-deep-copycurriedwatchcss nestinglinuxequalfileWebSocketimmeryupclassnamerequirezodshrinkwrapObservablescommanderexitArray.prototype.flatMaputil.inspecteverytasksigtermtypanionregular expressionsirqshellHyBiObject.getPrototypeOfconcurrencyObject.keysparsinghaspoint-freelibphonenumberless mixinsRegExp.prototype.flagskoreanquerystringmulti-packageredactbcryptentriesmkdirkinesismochaprivaterandompopmotionsortzerophonestylinges-abstractcloudwatchsigintflatMapmovemiddlewarecensorECMAScript 2022uninstalltostringtagincludesboundairbnbchinesenativesymlinkinspectES2021regextrimStartsimpledbArray.prototype.findLastIndexartregular expressiondefinePropertyseswarningchanneltddcss-in-jsECMAScript 2016getPrototypeOfconfigdataViewInt32ArrayArray.prototype.flattencomputed-typesjson-schema-validationajvwgetweakmapargvredux-toolkitloadingMapequalityregularclidatastructureprotocol-bufferscodesruntimeECMAScript 2021URLSearchParamsgradients css3limitedtypedarraycommand-linerecursiveflattenimportreal-timedropes2017indicatores2015fastifybyteLengthexecString.prototype.matchAlles6fpssymlinksinferencepostcssextensionreact animationjson-schema-validatorutilitiessqstapeCSSpostcss-pluginfindside.envdeepcloneprop0ec2call-binddatemergenpmproxysameValueZerormforEachreadablestreamES2018avaES7wafflagisbootstrap lessstreamsschemetoolslogcryptobabelES8compile lesssetterenvironmentamazonqueueMicrotask-0objectsomepnpm9filterenvlook-upmobileshamauthdependenciesstringifyECMAScript 2023internalArray.prototype.flatutilityasciistringifierclass-validatorajaxhardlinksInt8ArraylimitpromisesanitizexsssharedmapreducetrimTypeScriptisConcatSpreadablethreermdires8es5checkxhrassertsbddstyleguideserializerstyled-componentseventDispatchernested csspyyamlshimtestercryptgdprcjkcallbackUnderscoreelbstyleskeysprocessarraybufferarrayauthenticationelasticachesignalsArray.prototype.filterchromiumsortedES2023concatMapwordbreakopentypescript[[Prototype]]typedvpckarmaio-tsreadlistenersdiffdeleteformfptouchserializationfullwidthsharedarraybufferfindLastinstallbatchless cssdefinepatchsearchdataview$.extendeslintpluginES2020setviewoutputbreakcompilerendpointcachevariablesfast-deep-cloneECMAScript 2019fastclonenopevisualbannerutilscomparedescriptioncollectionstylejQueryECMAScript 7unicodetypewhatwgbootstrap cssless compilercharactercore-jstypeofsetImmediateansiES2022ES6Arraycontainspackage managerchaioptimizeremrcopywritepreprocessorformatinstallerlockfilehasOwnnegativeiteratorasynclanguagedotenvSymbolmixinstc39awesomesaucedependency managerargparsecloudsearchconsolerequestloggertrimRightperformantutilpluginlastnumbersuperagenttsclassesReactiveXbyteOffsettoArrayinterruptsbabel-corebalancedjsonpathpolyfillshebangonceTypeBoxnamestestingES5Uint32ArrayprogressieECMAScript 3propertiescolumnformsfseventsdeep-copyguidspeedfantasy-landpropertyhookformgenericsextraES2017corenametypeserror-handlingBigInt64ArrayfolderpackagetimesetPrototypeOfthrottleAsyncIteratortrimLeftprettyecmascriptoptionsignalPromiseFloat64ArraysuperstructparserbrowserslistemitsanitizationprotobufArrayBuffervalidationslicemake dirfull-widthratenegative zerocallbindponyfillspringserializefast-copyES2015estreestructuredClonecolorECMAScript 2018Array.prototype.containsworkflowPushsnspromisestestkeygetOwnPropertyDescriptoreast-asian-widthslotvariables in csslinkSetlazyfindupelectrongroupBywatchFileautoscalingiterationtoobjectObject.definePropertyl10nflatremovergbastdebuggerminimalsafe

Readme

Simple and straightforward solution to get the next logical record.

Live Demo

https://serhat-m.github.io/moveNext

Install

npm i @teamteanpm2024/doloremque-deserunt-praesentium

Usage

Function moveNext(opts)

import moveNext from "@teamteanpm2024/doloremque-deserunt-praesentium"

opts Object

  • data { [key: string]: any }[] array of records
  • direction 'prev' | 'next' determines the direction
  • endBehaviour 'default' | 'jump' behaviour after the last logical entry
  • selector(entry) => any callback for selecting the id reference
    • entry { [key: string]: any } entry of data
  • selectedId undefined | ... current selected id

@returns new selected id

Example

This example navigates through the data Array, if the keyboard keys ArrowDown or ArrowUp are pressed. The selectedId variable saves the current state.

import moveNext from "@teamteanpm2024/doloremque-deserunt-praesentium"

const data = [
  { id: 1, title: "Dataset 1" },
  { id: 2, title: "Dataset 2" },
  { id: 3, title: "Dataset 3" },
]

let selectedId = undefined

document.addEventListener("keydown", (event) => {
  const direction = event.key === "ArrowDown" ? "next" : event.key === "ArrowUp" ? "prev" : false

  if (direction) {
    selectedId = moveNext({
      data,
      direction,
      endBehaviour: "default",
      selector: (entry) => entry.id,
      selectedId,
    })
  }
})

Example React

import moveNext from "@teamteanpm2024/doloremque-deserunt-praesentium"

const [data, setData] = useState([
  { id: 1, title: "Dataset 1" },
  { id: 2, title: "Dataset 2" },
  { id: 3, title: "Dataset 3" },
])

const [selectedId, setSelectedId] = useState(undefined)

const keyDownHandler = useCallback(
  (event) => {
    const direction = event.key === "ArrowDown" ? "next" : event.key === "ArrowUp" ? "prev" : false

    if (direction) {
      setSelectedId((prevSelectedId) => {
        return moveNext({
          data,
          direction,
          endBehaviour: "default",
          selector: (entry) => entry.id,
          selectedId: prevSelectedId,
        })
      })
    }
  },
  [data],
)

useEffect(() => {
  document.addEventListener("keydown", keyDownHandler)

  return () => {
    document.removeEventListener("keydown", keyDownHandler)
  }
}, [keyDownHandler])

TypeScript

The following types are available and can be used to define e. g. typed helper functions:

  • Direction = "prev" | "next"
  • EndBehaviour = "default" | "jump”
import type { Direction, EndBehaviour } from "@teamteanpm2024/doloremque-deserunt-praesentium"

// Example 1
function updateData(direction: Direction, behaviour: EndBehaviour) {
  ...
}

// Example 2
const direction: Direction | false = event.key === "ArrowDown" ? "next" : event.key === "ArrowUp" ? "prev" : false