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

jsonql-utils

v1.4.1

Published

This is a jsonql dependency module, not for generate use.

Downloads

55

Readme

jsonql-utils

This is a dependency module for various jsonql node / browser modules. Not intend to use directly

Please check jsonql for more information.

complete list of all available functions

When use with build tool, for better tree shaking. You need to import them directly. Please reference which functions in what file below

Browser and node.js

src/chain-fns.js

  • chainFns

src/chain-promises.js

  • chainPromises
  • chainProcessPromises

src/contract.js

  • checkIsContract
  • isContract (alias to checkIsContract but when it's true return the contract itself)
  • extractSocketPart
  • groupByNamespace
  • getNamespaceInOrder
  • extractArgsFromPayload
  • extractParamsFromContract

src/timestamp.js

  • timestamp

src/dasherize.js

  • dasherize

src/urls.js

  • urlParams
  • cacheBurstUrl
  • cacheBurst

src/generic.js

  • inArray
  • toArray
  • parse
  • isObjectHasKey
  • createEvt
  • getConfigValue
  • toJson
  • isNotEmpty
  • isFunc
  • nil (placeholder function always return false)
  • assign (alias to Object.assign)
  • freeze (alias to Object.freeze)

src/logger.js

  • logger (wrapper for console.log to use in browser, set window.DEBUG=true then it will show)

src/obj-define-props.js

  • objDefineProps
  • objHasProp
  • injectToFn

src/params-api.js

  • toPayload
  • formatPayload
  • getNameFromPayload
  • createDeliverable
  • createQuery
  • createQueryStr
  • createMutation
  • createMutationStr
  • getQueryFromArgs
  • processPayload
  • getQueryFromPayload
  • getMutationFromArgs
  • getMutationFromPayload

src/results.js

  • getCallMethod
  • packResult
  • isJsonqlErrorObj
  • packError
  • resultHandler

For node.js only

src/jsonql-handler.js

  • isJsonqlPath
  • isJsonqlRequest
  • isJsonqlConsoleUrl

src/node-error.js

  • replaceErrors
  • printError

src/node-find-from-contract.js

  • findFromContract

src/node-koa.js

  • handleOutput
  • handleHtmlOutput
  • ctxErrorHandler
  • forbiddenHandler

src/node-middleware.js

  • getDocLen
  • headerParser
  • isHeaderPresent
  • getPathToFn

Breaking change (0.6.4)

The module now only export the browser used modules. The main field comes with everything including all the node.js one.

For browser package, you want to do this

import { chainFns } from 'jsonql-utils/module'

But this doesn't help with the tree shaking (Tree shaking is a total lie anyway). So you might want to import like what it show in the above section.

For node/cjs then just do it like you normally would.


const { chainFns } = require('jsonql-utils')

ISC

Joel Chu (c) 2020