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

node-px2rem-converter

v1.0.6

Published

a tool which can convert px to rem used in css or less files.

Downloads

11

Readme

px转rem的node工具

Build Status NPM version codebeat badge

这是一个基于nodejs的将样式文件中的px单位转换为rem单位的工具,通过项目目录下的命令行中输入指定的指令实现批量转换指定文件的px单位。

需要注意的是,转换所需必要的参数需要从配置文件中读取,如不添加配置文件,会按照默认的配置进行转换,可能会对项目有影响,此插件提供了初始化配置文件的命令,建议先执行初始化后再开始转换。

使用

  • 安装
yarn add node-px2rem-converter
  • 初始化
"./node_modules/.bin/px2rem" -I
  • 开始转换
"./node_modules/.bin/px2rem" -R

配置文件

执行了初始化后,自动在项目根目录生成一个px2rem.yml配置文件,建议在开始转换之前设置配置文件中的配置项

includeDirs

执行转换的目录的路径,默认为src目录

excludeDirs

不执行转换的目录的路径

excludeFiles

不执行转换的文件的路径,这个配置和excludeDirs都是在includeDirs中过滤对应的目录和文件

includeFiles

执行转换的文件的路径,这里的文件与目录的设置是单独的,文件可以不在已设置的转换目录中,同时目录和设置不转换的文件配置不会影响此设置

fileTypes

执行转换的文件的类型,默认为cssless,目前只支持cssless类型的文件,后续开发时考虑加入其他类型的文件

ratio

转换的比例设置,默认为100

eol

使用的换行符,可以选择\n\r\n两种的一种,默认为当前系统默认的换行符