gatsby-source-npmjs
Gatsby plugin for pulling files into Gatsby from npmjs.com
Last updated 9 days ago by wangshijun .
ISC · Original npm · Tarball · package.json
$ cnpm install gatsby-source-npmjs 
SYNC missed versions from official npm registry.

gatsby-source-npmjs

Source plugin for fetching files into the Gatsby graph from npmjs.com;

Install

npm install gatsby-source-npmjs

Usage

In your gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: require.resolve('gatsby-source-npmjs'),
      options: {
        name,
        patterns: [
          '**/blocklet.json',
          '**/blocklet.md',
          '**/logo.{jpeg,jpg,png,gif,svg}',
          '**/screenshots/*.{jpeg,jpg,png,gif,svg}',
          '**/package.json',
        ],
      },
    },
  ],
};

Query

You can query the nodes using GraphQL, like from the GraphiQL browser: localhost:8000/___graphql.

{
  query allFile {
    edges {
      node {
        id
        absolutePath
        relativePath
        internal {
          type
          mediaType
        }
        base
        publicURL
        npmMeta {
          repoName
          repoHref
        }
        childMarkdownRemark {
          htmlAst
        }
      }
    }
  }
}

Current Tags

  • 7.24.6                                ...           latest (9 days ago)

7 Versions

  • 7.24.6                                ...           9 days ago
  • 7.22.0                                ...           2 months ago
  • 7.17.2                                ...           2 months ago
  • 7.11.0                                ...           2 months ago
  • 7.5.1                                ...           3 months ago
  • 7.5.0                                ...           3 months ago
  • 7.4.2                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 15
Last Month 18
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |