
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Make your own Google Fonts API with some extra features
http://localhost:3000/types?name=serif&orderBy=popularity&dir=desc
http://localhost:3000/search?name=roboto
http://localhost:3000/search?orderBy=family&dir=asc
git clone https://github.com/ClickSimply/buzzfont.git
cd buzzfeed && npm i
Open the sample-server.js
file and upate the details at the top.
const PORT = 3000;
const PUBLIC_URL = `http://localhost:${PORT}`;
const APIKEY = "YOUR GOOGLE KEY HERE";
node sample-server.js
The script will generate preview URLs for every font available (over 800), then will start the express server. The example queries above will work from here.
The library itself doesn't have any expressJS or other server code. It just handles the indexing of the fonts and other cool stuff.
You can easily embed the library in your own project. The "sample-server.js" file shows a full working example of the script working with express, a smaller example is below.
npm i buzzfont --save
const BuzzFont = require("buzzfont").BuzzFont;
const express = require("express");
const http = require("http");
const PORT = 3000;
const PUBLIC_URL = `http://localhost:${PORT}`;
const APIKEY = "YOUR GOOGLE KEY HERE";
const fontDB = new BuzzFont({
apiKey: APIKEY,
baseURL: PUBLIC_URL,
ready: () => {
const app = express();
// Serve the preview images
app.use("/previews", express.static("./previews"));
// Once initilized, the library exposes fontDB.nSQL() as a nanoSQL store containing the fonts
// Read about how to use nanosql here https://github.com/ClickSimply/Nano-SQL/wiki/2.-Query
// Handle queries with nanosql
app.get("/search", (req, res) => {
fontDB.nSQL()
.query("select")
.where(["family", "LIKE", req.query.name])
.exec().then((rows) => {
res.send(rows).end();
});
});
// Run Server
http.createServer(app).listen(PORT, () => {
console.log("Server listening on %d", PORT);
});
}
});
FAQs
Your Own Powerful Google Fonts API
The npm package buzzfont receives a total of 10 weekly downloads. As such, buzzfont popularity was classified as not popular.
We found that buzzfont 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.