@gravityforms/utils

3.0.0 • Public • Published

Gravity Forms Utils

Custom JavaScript utilities for Gravity Forms development and beyond.

Installation

Install the module as a dependency.

npm install @gravityforms/utils --save

Note: This package requires node 20.10.0 or later, and npm 10.2.3 or later.

Overview

A collection of JavaScript utilities that we use in our day to day JavaScript. This package is delivered as es6 modules, you probably want your webpack or other bundling system to run it through babel.

In the case of webpack and babel, this means adding it to your exclude property of the rules array in the module object, like so:

const config = {
	// other config
	module: {
		rules: [
			{
				test   : /\.js$/,
				exclude: [ /node_modules\/(?!(@gravityforms)\/).*/ ],
				use    : [
					{
						loader: 'babel-loader',
					},
				],
            }
        ],
	},
}

Usage

Example:

import { isJson } from '@gravityforms/utils';

const doSomethingWithJson = ( data ) => {
	if ( ! isJson( data ) ) {
		return;
    }
}

Documentation

The documentation for this package is available at http://docs.js.gravity.com/

Package Sidebar

Install

npm i @gravityforms/utils

Weekly Downloads

235

Version

3.0.0

License

GPL-2.0-or-later

Unpacked Size

179 kB

Total Files

141

Last publish

Collaborators

  • nickpelton
  • carlhancock
  • mbelenmontoya
  • laborin
  • sswebster
  • ryanurban
  • paulmskim
  • sherifmesallam
  • alexcancado
  • wpalchemist
  • speerface
  • faction23