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

magento2-helper

v0.3.2

Published

Command-line tool meant to simplify and streamline the Magento 2 development process

Downloads

3

Readme

magento2-helper

What is this?

The Magento 2 Helper (aka "m2") is a command-line utility meant to simplify and streamline the Magento 2 development process.

It does this by:

  • Combining commands which are typically used together
  • Reducing the keystrokes needed to enter frequently used commands

In addition to providing a number of shortcuts out of the box, m2 is extensible, allowing users to add further commands with relative ease.

Will this tool revolutionize your world? Not likely. But it should help take a bit of the pain out of your workflow so that you can focus less on entering repetitive terminal commands, and more on writing some awesome code.

Installation & Usage

To install:

npm i -g magento2-Helper

To use:

m2 [command] <arguments>

# For a list of commands
m2 --help
# For usage information
m2 --help [command]

Examples

Please note that these are only a couple examples of what m2 does -- m2 contains many other commands which will be documented elsewhere.

Setting up and running Grunt

A typical Grunt workflow involves generating symlinks, compiling the symlinked Less into CSS, and finally watching for further changes.

Default Magento 2:

grunt exec:mytheme
grunt less:mytheme
grunt watch:mytheme

By default, this requires waiting for each command to complete before manually entering the next command.

With magento2-helper:

m2 e -lw

Not only does m2 automatically run the above sequentially, it remembers your default theme on a per-project basis so that typing it repeatedly is unnecessary.

Refreshing Magento after switching git branches

Development often requires hopping between several branches throughout the day. Oftentimes different branches will have different Composer modules, Less files, other differences. Clearing these out in order to continue development requires entering a number of commands.

Default Magento 2:

php bin/magento cache:flush
php bin/magento setup:upgrade
# Deploy mode occasionally changes after setup:upgrade
# and has to be set back to 'developer'
php bin/magento deploy:mode:set developer
grunt exec:mytheme
grunt less:mytheme

Depending on the project, running all of these commands can be a rather lengthy process which requires the developer's constant attention in order to enter the next command in the sequence.

With magento2-helper:

m2 r

In classic infomercial fashion, m2 lets you "set it and forget it", running the above commands on its own and letting you focus on other matters while it runs.

Further Use

For a full list of all commands and their available options, run m2 with the --help flag.