DEV Community

Jan Dvorak
Jan Dvorak

Posted on • Updated on

Official Meteor packages that you might want in you app

โ˜„ Meteor offers amazing functionality out of the box, but there are also some amazing official packages that can add even more to your application. Here is my personal list of packages that you might want to consider adding to your application.

โœ… check & audit-argument-checks

These are a must have packages. audit-argument-checks checks to make sure that you validate all the input in your method calls with the check package.
After adding audit-argument-checks it will report to you in console about inadequate input checks as you navigate through your app.
check package should be used to validate any input into your subscriptions and methods.

โ‰๏ธ mdg:validation-error

This function allows you to define validation errors on the server and provide more data to better display the error on the client.

๐Ÿ›‚ mdg:validated-method

The ultimate way of creating methods. If you have a more complex app you might have experienced some pains working with the default Meteor methods. validated-method was a second attempt to add more functionality to the method to alleviate the most common problems. Most notable is the inclusion of schema validation (hence the name).
If you are not using it though, you might want to wait a bit as it is a bit dated and a third iteration has been proposed.

๐Ÿ”’ force-ssl

A must for any production app. This package will redirect unsecured request to a secure URL.

๐Ÿ” mdg:seo

SEO has always been tricky for JavaScript apps. This package aims to help in this regard (especially if you hosting on Galaxy) by utilizing to create a searchable version of your app for crawlers.

๐Ÿ“Š bundle-visualizer

Best if you create a specialize start command like this:
meteor --extra-packages bundle-visualizer --production
This will allow you to examine your bundle size and see where you should load dynamically or cur some fat from your app.

๐Ÿ’ผ ejson

Extended and Extensible JSON library reads the description and you most likely already have it as a dependency of another of your packages. It adds date and binary types support to json and allows you to add your own as well.

#๏ธโƒฃ random

Need a random (Meteor) id or a new secret key or just want a random element from an array. This and a bit more is in this package.

๐Ÿ™€ reactive-dict & reactive-var

As the name suggests these packages allow you to setup reactive dictionary and variable to work with Tracker or if can also be used as a sort of app state.

๐Ÿƒ fetch

If you are calling other servers on old fashioned APIs you probably use the http package and recently you might have been annoyed with a deprecation warnings. Despair not! Fetch is here to usher you into the future! Refer to the MDN documentation and import everything from the fetch package and you should be fine. The good thing is that where possible native implementation is used and in other cases the package provides polyfills.

๐Ÿ”— url

The url package does the same like fetch, but for the URL API. In addition if you are using react-router and need to get search params, you might want to give URLSearchParams from this package a try.

๐Ÿšง Logging

The last on this list which will require a bit of a digging is the Meteor logging packages. Although meant for internal Meteor processes, there is no reason why you couldn't use it if you don't have anything better.
It is a small package, so a quick on the source code should give you all the info you need.

๐Ÿ‘ฎ DDP rate limiter

A very useful package to limit how frequently your users can call the server via DDP. This is in essence a security package that prevents brute force attacks. You can define rules for your methods and publications that will check that all conditions have been fulfilled before proceeding with the request. Most commonly this is used by the accounts package to limit the number of login attempts, reset password attempts, etc. to prevent brute force attacks, but you can use that for pretty much anything. Check out the docs for more info.

If you like my work, please consider supporting me on GitHub Sponsors โค๏ธ.

Top comments (0)