Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
generator-mrhenry
Advanced tools
Production ready, but use with caution. When stuck, ask Pieter.
Trying out Yeoman to do our project setup in a breeze with some simple questions and conditional downloading.
One command to rule them all: $ npm install -g yo generator-mrhenry
.
Let's get ready to rumble.
$ yo mrhenry
Runs a basic, one time setup of the front-end approach on top of your existing back-end files. You'll have to answer a few questions to get you started.
Note - when asked if you want to override certain files, answer yes
Note - verify that everything is working correctly by trying to run $ gulp watch
Running this setup gives you a basic view for ApplicationPage
(living in /pages/application/application
) as an example, the base class for all resources, basic setup & configuration and the following NPM modules:
mr-haraway
for easy assets.sh image embedding (with size optimizing & retina support, woop!)mr-nav-state
for all your .is-active
CSS goodnessfd-html-content
for robust HTML rendering (still to be ported to NPM)Other just-add-water NPM modules maintained by us include:
mr-timeago
for when 20 minutes ago works better than an UNIX timestampThis is where the cool becomes awesome. Using subgenerators we can generate all neccessary views & files in a breeze.
yo mrhenry:ng-page name [--resource resource] [--path path]
Creates an @Page
instance. This name should be a Lalala page type for it to work out of the box.
--path
- specify a path where the page folder should be created.--resource
- create an overview & detail state for a certain resource. More on resources below.Let's say you want to have a custom view for your Lalala HomePage
.
$ yo mrhenry:ng-page home
Add import './pages/home/home';
to your application.js
, build & you're good to start styling!
You have a page of type NewsPage
and you want that to be an overview of Post
model instances. Post
will be a resource (see below) in the front-end app.
$ yo mrhenry:ng-page news --resource post
Import ./pages/news/news
, build, et voila. With routes etc!
It is very easy to render the childs inside an overlay. Check with Pieter until the README is updated.
yo mrhenry:ng-resource name [--endpoint endpoint] [--controller]
A resource is an easy way to handle custom models in the back-end if we stick to some basic conventions concerning HTTP endpoints.
A resource has certain methods that return promises with the JSON response. Benefits are:
format()
method, so you can rest assured all properties will be available, making undefined is not a function
a thing of the past.--endpoint
- override default pluralization of resource name; to avoid sheeps and keep with sheep ;)--controller
- generate a Rails controller with index
and show
methodsAs in the above page overview example, let's create a Post
resource.
$ yo mrhenry:ng-resource post
You now have a Post
service that you can @Inject
everywhere. Possible calls:
Post.all.then(posts => { doSomething(posts); });
Post.find(2).then(post => { renderDetail(post); });
$ yo mrhenry:ng-component name [--template]
Just a quick way to create a directive because hell yeah, we're lazy.
--template
- Use this flag if you want your directive to have an HTML template$ yo mrhenry:ng-service name
As above, a quick way to create a service because, …, still lazy.
FAQs
Mr. Henry + Lalala + Angular.js = 💃
We found that generator-mrhenry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.