
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
This node.js module will help with /valid-path-params-3/just-like-that-4/
. With meaningful, it's easy to use meaningful path names instead of IDs.
Say you'd like to use permalinks like /photos/{userId}/{photoId}.jpg
but you don't want to expose ids, because they're
ugly and useless to search engines. Meaningful.js can help!
npm install meaningful
var mf = require("meaningful");
mf.meaningful('Chris Hartwig / amazing user', myUserId, function (sanitizedName) {
// sanitizedName is now "Chris-Hartwig-amazing-user" which you can use in the url
}
Now imagine your rest api :
// the url contains the sanitizedName
app.get("/photos/:user", function(req, res) {
var sanitized = req.params.user; // sanitized == "Chris-Hartwig-amazing-user"
mf.idOfMeaningful(sanitized, function(id) {
// now you have your id (same as myUserId)
}
}
Does it support collisions? yes, you can have many "values" with different IDs (automatic numerical suffix). So if another 'Chris Hartwig / amazing user' registers (with a different user id), his meaningful name will be Chris-Hartwig-amazing-user-1
Does it support modifications? yes, if 'Chris Hartwig / amazing user' changes to a less radical 'Chris Hartwig', the new and the old url will point to the same userId to avoid 404s.
The only dependency is for Redis...
You can customize the way you connect to Redis:
var mf = require('meaningful');
var client = md.createClient(myVerySpecialURL);
mf.getClient = function () { // let's overload getClient
return client;
};
FAQs
Easy creation of urls segment from (String+Id)
We found that meaningful demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.