npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chiubaca/gridsome-source-devto

v0.5.0

Published

Dev.to source for Gridsome & some extra computed properties

Downloads

21

Readme

DEV.to source plugin for Gridsome

This package is under development and API might change before v1 is released.

This is a Gridsome source plugin for DEV.to. It retrieves all your published articles via the DEV API (beta).

This plugin merges and exposes the entire schema for both the getArticles and getArticleById so you can benefit from both endpoints effortlessly. This is useful because for example; page_views_count is available on getArticles but not on getArticleById. On the flip-side body_html is available on getArticleById but not on getArticles. Not sure why DEV.to implemented their API like this, but with this plugin, you don't need to worry about it.

Available DEV.to attributes

  • type_of

  • id

  • title

  • description

  • published

  • readable_publish_date

  • published_at

  • slug

  • url

  • comments_count

  • public_reactions_count

  • page_views_count

  • collection_id

  • published_timestamp

  • positive_reactions_count

  • social_image

  • canonical_url

  • created_at

  • edited_at

  • crossposted_at

  • published_at

  • last_comment_at

  • tag_list

  • tags

  • body_html

  • body_markdown

  • user

Computed attributes

  • parsed_markdown: Similar to body_html. However the parsed markdown has been processed to provide some additional extras such syntax highlighting by prism.js and github style auto links. Note: shortcodes are not parsed.

  • time_to_read: Estimated time to read an article based on 200 word per minute.

Install

  • yarn add @chiubaca/gridsome-source-devto
  • npm install @chiubaca/gridsome-source-devto

Example Usage

// gridsome.config.js
module.exports = {
  plugins: [
    {
     use:'@chiubaca/gridsome-source-devto',
      options : {
        typeName: 'DevToArticles',
        devtoAPIKey: process.env.DEVTO_KEY
      }
    }
  ],
  templates: {
    DevToArticles: '/:title'
  }
}

Options

typeName - String (Required)

The prefix to be used for your imported schemas field types.

devtoAPIKey- String (Required)

Get your Dev.to API key by following this instructions https://docs.dev.to/api/index.html#section/Authentication/api_key. It is best to store your key in a .env file rather than exposing it inline in your gridsome.config.js files so that your key is not exposed publicly.

Custom Routes

To add custom routes use the templates config with the collection type name as the key and the custom route as the value.

// gridsome.config.js
module.exports = {
 templates: {
    DevToPosts: '/:title'
  }
}

Display All Articles

You may want to render a list of all article titles like this

<!-- src/pages/Index.vue -->
<template>
  <Layout>
    <h1>All Articles</h1>
    <div v-for="(post, index) in $page.posts.edges" :key="index">
      <g-link :to="post.node.path">{{ post.node.title }}</g-link>
    </div>
  </Layout>
</template>

<page-query>
  query{
    posts: allDevToArticles{
      edges {
        node{
          title
          path
        }
      }
    }
  }
</page-query>

Display A Single Article

You can render the each individual article in the DevToArticles.vue file.

<!-- src/templates/DevToArticles.vue -->
<template>
  <Layout>
    <article v-html="$page.posts.parsed_markdown" ></article>
  </Layout>
</template>

<page-query>
  query DevToArticles ($path: String!) {
    posts: devToArticles (path: $path) {
      title
      parsed_markdown
    }
  }
</page-query>

<script>
import '@/prism_themes/prism-tomorrow.css';
export default {
  metaInfo() {
    return {
      title: this.$page.blogs.title
    };
  }
};
</script>

To stylise your code blocks. You can download different stylesheets compatible with prism.js here.