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 🙏

© 2024 – Pkg Stats / Ryan Hefner

devii

v0.0.1

Published

A dev blog starter for the modern developer

Downloads

3

Readme

Devii 😎

A blog starter for the modern developer

Next.js + React + TypeScript + Markdown + syntax highlighting = 🔥🔥🔥

Get started

To get started, clone the repo and start the development server:

git clone [email protected]:vriad/devii.git
cd devii
yarn dev

The default project only contains two pages: a home page (http://localhost:3000) and a sample blog post (http://localhost:3000/blog/test).

To add a new blog post, just add a new Markdown file under /md/blog.

Powered by Next.js

Devii is powered by Next.js. We chose Next.js because it's the simplest, most elegant way to generate a static version of a React-based website.

Check out the Next.js documentation here to make sure it's the right choice for your project.

Frontmatter support

Every Markdown file can include a "frontmatter block" containing metadata: title, subtitle, tags, date (timestamp), author, authorPhoto, bannerPhoto, and thumbnailPhoto.

You can dynamically load and parse a Markdown file using loadMarkdownFile, a utility function implemented in loader.ts. It is an async function that returns a PostData TypeScript object containing all the metadata keys listed above:

type PostData = {
  path: string;
  title?: string;
  subtitle?: string;
  content: string;
  date?: number;
  author?: string;
  authorPhoto?: string;
  tags?: string[];
  bannerPhoto?: string;
  thumbnailPhoto?: string;
};

TypeScript + React

Devii is entirely built with TypeScript and functional React components. Implementing any sort of interactive widget is often hard with Markdown-centric static-site generators, but Devii makes it easy to mix Markdown and React on the same page.

You can either:

  • Drop a string of Markdown content into the <Markdown source={'# Markdown!'}/> component
  • Load the content from the file system by passing a file path into loadMarkdownFile. loadMarkdownFile looks for a file at the provided path _within the /md directory. So loadMarkdownFile('about.md') will look for a Markdown file at /md/about.md.

Medium-inspired design

The Markdown renderer (Markdown.tsx) provides a default style inspired by Medium. Just modify the CSS in Markdown.tsx to customize the design to your liking.

GitHub-style code blocks

You can easily drop code blocks into your blog posts using triple-backtick syntax (just like GitHub). No more embedding CodePen iframes! 🚀

Works out-of-the-box for all programming languages. Specify your language with a "language tag". So this:

turns into

// pretty neat huh?
const test: (arg: string) => boolean = (arg) => {
  return arg.length > 5;
};

Static generation

You can generate a fully static version of your site using yarn build && yarn export. This step is entirely powered by Next.js. The static site is exported to the out directory.

After its generated, use your static file hosting service of choice (Firebase Hosting, Amazon S3, Vercel) to deploy your site.

Insanely customizable

There's nothing "under the hood" here. You can view and modify all the files that provide the functionality listed above. Devii just provides a project scaffold, some Markdown-loading loading utilities (in loader.ts), and some sensible styling defaults (especially in Markdown.tsx).

To get started customizing, check out the source code of index.tsx (the home page), BlogPost.tsx (the blog post template), and Markdown.tsx (the Markdown renderer).

Head to the GitHub repo to get started: https://github.com/vriad/devii. If you like this project, leave a ⭐️star⭐️ to help more people find Devii 😎

CLI

yarn dev

Starts the development server. Equivalent to next dev.

yarn build

Creates an optimized build of your site. Equivalent to next build.

yarn export

Exports your site to static files. All files are written to /out. Use your static file hosting service of choice (Firebase Hosting, Amazon S3, Vercel) to deploy your site. Equivalent to next export.