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

laravel-js-helpers

v1.0.3

Published

Laravel helpers within javascript (data_get, data_set, data_fill, collect)

Downloads

32

Readme

Travis npm license PRs Welcome dependencies npm version HitCount Open Source Love svg1 Maintenance


Laravel JS Helpers


"Laravel Helper Methods In Javascript"


Installation

NPM

npm install --save-dev laravel-js-helpers

Yarn

yarn add laravel-js-helpers --save

CDN

<script src='https://unpkg.com/laravel-js-helpers@latest/build/index.min.js'></script>

Playground Examples


Curious, but not 100% on whether this is what you're looking for?


Utilization



Data Get


Data Get Simple

data_get(family, 'family.members.brother.name');

Data Get Output

"drew"

Data Get Wildcard("*")

data_get(family, 'family.members.*.age'); 

Data Get Wildcard Output

[17, 25, 'thats not polite', 50];

Data Set


Data Set Simple

data_set(family, 'members.brother.age', 21);
data_set(family, 'members.brother.name', 'Everett');

Data Set Wildcard("*")

data_set(family, 'members.*.last_name', 'Smith');

Data Set Output

{
	members: {
		brother: {
			age: 21,
			name: 'Everett',
			last_name: 'Smith',
			hobbies: ['football', '"chillin"', 'video games']
		},
		sister: {
			age: 25,
			name: 'ash',
			last_name: 'Smith',
			hobbies: ['mothering babies', 'fitness', 'nutrition', '']
		},
		mother: {
			name: 'amy',
			last_name: 'Smith',
			age: 'thats not polite',
			hobbies: ['cleaning', 'nursing', 'hiking']
		},
		father: {
			age: 50,
			name: 'jon',
			last_name: 'Smith',
			hobbies: ['reading', 'sports', 'talking for seemingly ever', 'providing useful insights']
		},
	}
}

Data Fill


Data Fill Simple

data_fill(family, 'members.brother.age', 23); // wont do anything
data_fill(family, 'members.brother.name', 'Zak'); // wont do anything
data_fill(family, 'members.brother.birthday', 'April 22'); // will do something

Data Fill Wildcard("*")

data_fill(family, 'members.*.last_name', 'Horton'); // wont do anything
data_fill(family, 'members.*.nickname', 'Hortonion'); // will do something

Data Fill Output

{
	members: {
		brother: {
			age: 21,
			name: 'Everett',
			last_name: 'Smith',
			birthday: 'April 22',
			nickname: 'Hortonion',
			hobbies: ['football', '"chillin"', 'video games']
		},
		sister: {
			age: 25,
			name: 'ash',
			last_name: 'Smith',
			nickname: 'Hortonion',
			hobbies: ['mothering babies', 'fitness', 'nutrition', '']
		},
		mother: {
			name: 'amy',
			last_name: 'Smith',
			nickname: 'Hortonion',
			age: 'thats not polite',
			hobbies: ['cleaning', 'nursing', 'hiking']
		},
		father: {
			age: 50,
			name: 'jon',
			last_name: 'Smith',
			nickname: 'Hortonion',
			hobbies: ['reading', 'sports', 'talking for seemingly ever', 'providing useful insights']
		},
	}
}

Contribute


PRs are welcomed to this project. If you want to improve the laravel-js-helpers library, add functionality or improve the docs please feel free to submit a PR.


Security Vulnerabilities


If you discover a security vulnerability within Clean Code Studio Packages Or Specifically within laravel-js-helpers, please send an e-mail to Zachary Horton via [email protected]. All security vulnerabilities will be promptly addressed.


Change Log


Release 1.0.3


  • CDN

  • Tests

  • Change Log

  • Documentation

  • Travis Continuous Build Integration


Release 1.0.2


  • data_get
  • data_set
  • data_fill
  • transform
  • value
  • blank
  • filled
  • collect

Release 1.0.1


  • Initial Simple Documentation Setup

Release 1.0.0


  • Initial Setup

Versioning


Semantic Versioning

|Code Status|Stage|Rule|Example Version| |---|---|---|---| |First release|New Product|Start with 1.0.0|1.0.0| |Backward compatible bug fixes|Patch Release|Increment the third digit|1.0.1| |Backward compatible new features|Minor Release|Increment the middle digit and reset last digit to zero|1.1.0| |Changes that break backward compatibility|Major Release|Increment the first digit and reset middle and last digits to zero|2.0.0|


License


MIT © Zachary Horton (Clean Code Studio)