sails-stdlib
Standard library for Node/Sails applications.
This package contains a set of hand-picked, trusted modules recommended by the Sails core team.
Installation
npm install sails-stdlib --save
Usage
var stdlib = require('sails-stdlib');
var Gravatar = stdlib('gravatar');
var Mailgun = stdlib('mailgun');
Documentation
General
Scripts and NPM Packages
App Servers & Web APIs
Example
var stdlib = require('sails-stdlib');
var Gravatar = stdlib('gravatar');
var Mailgun = stdlib('mailgun');
var imageGravatar.getImageUrl({
emailAddress: 'amy@gonzales-enterprises.com',
gravatarSize: 400
}).execSync();
Mailgun.sendHtmlEmail({
apiKey: 'key-3432afa32e9401482aba183c13f3',
domain: 'sandbox5f89931913a9ab31130131350101.mailgun.og',
toName: 'Amy Gonzales',
subject: 'Welcome, Amy!',
htmlMessage: 'Amy,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management',
fromEmail: 'harold@example.enterprise',
fromName: 'Harold Greaseworthy',
}).exec(function (err) {
if (err) {
console.error('Failed to send email. Details:',err);
return;
}
console.log('Email sent!');
});
FAQ
I think I found a bug.
Thanks for taking the time to help out! Please create an issue in this repo and someone will look into it ASAP.
If you see how to fix the problem and have a moment to prepare a patch, feel free to submit a pull request to the appropriate repo.
Please be aware that we can't merge any unsolicited PRs that contain changes to usage, including additional methods or options.
With this project, we're trying really hard to keep things consistent between individual methods, and that means being
vigilant about the effect of any usage change in the grand scheme of the library.
I have an idea for how to improve...
We'd like to hear it! The best way to share your ideas is to contribute (see below).
I wish this supported...
We are constantly looking for ways to improve this library. If we're missing something you need from a particular pack,
tweet at @sailsjs to explain your use case and we'll see what we can do.
If you're in a hurry, just look up the repo for the package in question from the list below, then create a fork.
Where's the code?
Each package in the standard library lives in its own repository:
General
Scripts and NPM Packages
App Servers & Web APIs
Does this use semver?
Dependency versions are pinned, and all releases of sails-stdlib
are carefully tested to ensure strict semantic versioning.
Does this support custom builds?
You can install and use any of the packages in this repo individually. Just require the machinepack directly.
How do I run the tests?
Tests for each package are implemented in its repo.
What does the future hold?
The roadmap for this library is flexible and we're open to ideas. The important thing is that we remain relentlessly focused on stability and versatility,
while keeping the library relatively lightweight and the usage intuitive. Secondary to that, most of the immediate-term
improvements we're interested in making are related to performance.
I'd like to contribute.
Awesome! Tweet @sailsjs and let us know the minimum # of hours per week you'll
be able to commit, and someone from the core team will contact you ASAP.