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

yosuga

v0.1.5

Published

CSS styleguide generator

Downloads

7

Readme

yosuga

CSS styleguide generator

npm: nju33/yosuga tested with jest CircleCI Coverage Status code style: prettier license: mit

Demo

Page

https://nju33.github.io/yosuga/ yosuga: screenshot

Embed by <iframe/>

yosuga: embed-screenshot

QuickStart

https://github.com/nju33/yosuga-quickstart

CLI

https://github.com/nju33/yosuga-cli

Install

yarn add -D yosuga
npm i -D yosuga

Usage

Example

Code

import Yosuga from 'yosuga';

const yosuga = new Yosuga({
  icon: 'icon.png',
  name: 'Yosuga DEMO',
  base: `${process.cwd()}/example`,
  main: 'sass',
  style: {
    fontSize: '14px',
  },
  generate: {
    dir: 'docs',
  },
});

yosuga
  .prepare()
  .then(() => {
  // for development
    yosuga.serve();

  // if production
    // yosuga.generate('/yosuga/');
  })
  .catch(err => {
    console.log(err);
  });

Tree

Each (alt)css file must output the same content between the same basename. For targets other than css, * .yosuga.* is actually used for comparison.

.
├── css                          // optional
│   ├── button.css
│   ├── card.css
│   ├── nav.css
│   ├── tab.css
│   └── table.css
├── icon.png                     // optional
├── less                         // optional
│   ├── button.less
│   └── button.yosuga.less
├── postcss                      // optional
│   ├── button.css
│   └── button.yosuga.css
├── sass                         // optional
│   ├── button.scss
│   ├── button.yosuga.scss
│   ├── card.scss
│   ├── card.yosuga.scss
│   ├── nav.scss
│   ├── nav.yosuga.scss
│   ├── table.scss
│   └── table.yosuga.scss
├── stylus                       // optional
│   ├── button.styl
│   └── button.yosuga.styl
└── yosuga
    ├── button.html
    ├── card.html
    ├── nav.html
    ├── tab.html
    └── table.html

For example, if opts.main is set to less, only the button will be included in the site.

Options

interface Options {
  // Specify base directory
  // The default is `process.cwd()`
  base: `${process.cwd()}/example`;

  // Specify site's icon(logo) filename
  // e.g. `path.join(opts.base, opts.icon)`
  // if truthy, Yosuga make the icon of the sidebar to display above the title
  icon?: string;

  // Specify site's title
  // if truthy, Yosuga make the title of the sidebar to display
  name?: string;

  // Spacify main (alt)css
  // the default is `css`
  main?: 'css' | 'postcss' | 'sass' | 'less' | 'stylus';

  // Specify regular expression of filename that does not require HTML
  // e.g. `/variable/`
  ignore?: RegExp,

  // Map of each directory name
  dirs?: {
    // This is Interpret as `path.join(opts.base, opts.dirs[yosuga | css | postcss | sass | less | stylus])`
    yosuga?: string;
    css?: string
    postcss?: string
    sass?: string
    less?: string
    stylus?: string
    // the defaults is
    //
    // yosuga: 'yosuga',
    // css: 'css',
    // postcss: 'postcss',
    // sass: 'sass',
    // less: 'less',
    // stylus: 'stylus',
  },

  // Just `nuxt.generate`
  generate?: {
    dir?: 'docs';
  };


  // Adjust for your style
  style?: {
    fontSize?: string;
    accentColor?: string;
    // the defaults is
    //
    // fontSize: '13px',
    // accentColor: '#cb1b45'
  };

  // Adjust for your contents
  contents?: {
    readme?: boolean; // Add project's README.md into the document
    // the defaults is
    //
    // readme: true,
  };
}

License

The MIT License (MIT)

Copyright (c) 2018 nju33 [email protected]