
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
gatsby-transformer-code
Advanced tools
Load raw code of files
npm install --save gatsby-transformer-code
Note: You also need to have gatsby-source-filesystem
installed and configured so it
points to your files.
In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `examples`,
path: `./path/to/examples`,
},
},
{
resolve: `gatsby-transformer-code`,
options: {
name: `examples`,
},
},
],
}
Where the source folder ./path/to/examples
contains the example files.
name
- required, should be the same with the one from gatsby-source-filesystem
.extensions
- optional, only files with supported extensions will be transformed, default to ['js', 'jsx']
.test
- optional, regexp identifies which files should be transformed, if provided, extensions
will be ignored.You can query the nodes using GraphQL
, like from the GraphiQL browser: localhost:8000/___graphql
.
Regardless of whether you choose to structure your data in arrays of objects or single objects, you'd be able to query your letters like:
{
allRawCode {
edges {
node {
name
content
extension
instanceName
}
}
}
}
FAQs
Gatsby transformer plugin for code
The npm package gatsby-transformer-code receives a total of 15 weekly downloads. As such, gatsby-transformer-code popularity was classified as not popular.
We found that gatsby-transformer-code 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.