Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
astro-loader-github-repos
Advanced tools
Load GitHub repository data into the Astro content layer
This package enables you to load the data of the repositories in a GitHub org, and use the data in your Astro site.
Currently it provides githubReposLoader
, which loads the repositories of a single org. By default it will load all repositories, but you can filter the types of repos loaded.
npm install astro-loader-github-repos
This package requires Astro 4.14.0 or later. You must enable the experimental content layer in Astro unless you are using version 5.0.0-beta or later. You can do this by adding the following to your astro.config.mjs
:
export default defineConfig({
// ...
experimental: {
contentLayer: true,
},
});
You can then use the loader in your content configuration:
// src/content/config.ts
import { defineCollection } from "astro:content";
import { githubReposLoader } from "astro-loader-github-repos";
const repos = defineCollection({
loader: githubReposLoader({
auth: "YOUR-TOKEN", // Optional if only public repositories are requested
org: "withastro",
type: "public",
}),
// The loader provides its own type schema, so you don't need to provide one
});
export const collections = { repos };
You can then use these like any other content collection in Astro:
---
import { getCollection } from "astro:content";
import Layout from "../layouts/Layout.astro";
const repos = await getCollection("repos");
---
<Layout>
{
repos.map(async (repo) => (
<div>
<a href={repo.data.html_url}>{repo.data.full_name}</a>
<span>{repo.data.stargazers_count} stars</span>
</div>
))
}
</Layout>
The githubReposLoader
function takes an options object with the following properties:
auth
: A GitHub access token such as a personal access token or a GitHub App user access token, with at least the "Metadata" repository permissions (read). Optional if only public repositories are requested. See the GitHub API Authentication docs for more details.org
: The organization name for which to fetch the repositories. The name is not case sensitive.type
: The types of repositories to fetch. Can be one of: all
, public
, private
, forks
, sources
, member
. Defaults to public
.FAQs
Load GitHub repository data into the Astro content layer
The npm package astro-loader-github-repos receives a total of 1 weekly downloads. As such, astro-loader-github-repos popularity was classified as not popular.
We found that astro-loader-github-repos demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.