Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gatsby-remark-related-posts
Advanced tools
Calculate the similarity between posts by tf-idf and Cosine similarity.
Calculate the similarity between posts by tf-idf and Cosine similarity.
npm i --save gatsby-remark-related-posts
// In your gatsby-config.js
plugins: [
// ... other plugins
`gatsby-remark-related-posts`,
// ... other plugins
];
or
// In your gatsby-config.js
plugins: [
// ... other plugins
{
resolve: 'gatsby-remark-related-posts',
options: {
doc_lang: 'en', // optional
target_node: 'MarkdownRemark', // optional
getMarkdown: (node) => node.rawMarkdownBody, // optional
each_bow_size: 30, // optional
},
},
// ... other plugins
];
option | type | description |
---|---|---|
doc_lang | "en" | "ja" (default: "en") | ISO 639-1 language code of your post. |
target_node | "MarkdownRemark" | "Mdx" | "StrapiArticle" (default: "MarkdownRemark") | Gatsby node name to calculate similarity. |
getMarkdown | Function: (node) => string (default: (node) => node.rawMarkdownBody) | Function to get Markdown text from Gatsby node. |
each_bow_size | number (default: 30) | Adjust the size of the Bow vector. If you encounter problems during build, set it to a small value. |
// query
`
{
relatedMarkdownRemarks(parent: {id: {eq: $markdownRemarksId}}) {
posts {
frontmatter {
title
}
fields {
slug
}
}
}
}
`;
// result
{
"data": {
"relatedMarkdownRemarks": {
"posts": [
{
"frontmatter": {
"title": "English language"
},
"fields": {
"slug": "/11/"
}
},
{
"frontmatter": {
"title": "Japanese language"
},
"fields": {
"slug": "/12/"
}
},
{
"frontmatter": {
"title": "Spanish language"
},
"fields": {
"slug": "/13/"
}
},
// ...
]
}
},
}
posts
is array of MarkdownRemark
ordered by related to $markdownRemarksId
.
MIT
FAQs
Calculate the similarity between posts by tf-idf and Cosine similarity.
The npm package gatsby-remark-related-posts receives a total of 344 weekly downloads. As such, gatsby-remark-related-posts popularity was classified as not popular.
We found that gatsby-remark-related-posts 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.