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

yield-cli

v1.0.1

Published

yield-cli transform file

Downloads

7

Readme

npm GitHub stars GitHub issues GitHub license

yield-cli

全局命令行工具,用于转换多种文件,转换表如下

|转换前文件类型|转换后文件类型| |-------------|-------------| |js:es6+|js:es5| |scss|css| |sass|css| |xx|xx|

安装

全局安装 npm i yield-cli -g

指令

  1. 设置输入文件 yield [input] 自动识别index文件名
// 默认在指令目录下生成dist文件夹,将转换后的同名文件存入其中

// 自动寻找index文件,优先匹配以js、css、scss、sass结尾的文件进行转换 
yield

// 匹配以js、css、scss、sass结尾的文件进行转换 
yield index

// 转换当前目录下的 index.sass 文件
yield index.sass
  1. 设置输出文件 yield [input] -o [target file name] 默认与输入文件名相同名称
// 设置输出文件名,不包含后缀

// index.sass 输出到 dist/main.css
yield index.sass -o main

// index.sass 输出到 dist/main.css,忽略输出后缀
yield index.sass -o main.scss
  1. 设置输出目录 yield [input] -d [target dir] 默认dist目录
// 设置输出文件目录,默认dist

// 输出到指令目录下的lib文件夹中
yield index.js -d lib
  1. 设置输出文件类型 yield [input] -t [target type] 默认会识别输入文件类型并进行转换输出
// 设置输出文件后缀类型,默认js

// index.sass 输出为 index.css
yield index.sass -t css
// 等同于
yield index.sass
  1. 设置输出文件压缩 yield [input] -m 默认不启用压缩
// 设置输出文件压缩,sass、scss同使用compressed效果

// 压缩文件
yield index.js -m

// 压缩css
yield index.scss -m
// 等同于
yield index.scss -s compressed
  1. 设置每次自动删除输出文件夹 yield [input] -n 默认不自动删除
// 设置自动删除整个输出目录

// 自动删除,并重新生成
yield index.js -n
  1. 设置sass、scss输出样式 yield [input] -s <outputType> 默认使用nested,可选expanded、compact、compressed
// 设置输出css样式格式

// 默认,嵌套样式
yield index.scss -s nested

// 类似手写样式
yield index.scss -s expanded

// 每条 CSS 规则只占一行
yield index.scss -s compact

// 压缩样式
yield index.scss -s compressed

其他指令

  • 帮助指令 yield -hyield --help 查看指令列表
  • 查看 yield-cli 版本 yield -Vyield --version

更多指令支持中。。。