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

astros

v1.0.13

Published

简洁、高效的前端集成开发环境。

Downloads

49

Readme

Astros是一个前端集成开发环境,旨在通过工具自动化完成大部分非思考性的工作,如JS合并、脚本压缩、图片优化、合成雪碧图和字体文件等,让程序员更能享受编程本身。

Astros的核心,是做为一个前端静态资源服务器,每次请求,都是实时处理并返回。在Astros中,任何资源,如js、css、图片、字体、视频等都是一个Asset,收到请求后,依次调用可用的中间件完成对Asset的解析、依赖分析、优化等操作,最后返回处理结果。

通过Astros目前提供的中间件,已能完成如下功能:

  • 自动合并雪碧图
  • 根据SVG,自动合成字体文件
  • 二倍图转一倍图(只需要切2倍图,自动生成1倍图)
  • 自动对图片进行无损压缩,并附加交错属性
  • 解析LESS,自动完善样式HACK(如为border-radius添加-wekit-等前缀)
  • CSS和JS压缩
  • 支持在浏览器端使用CMD模式
  • HTML自动转JS模板(正常书写HTML,JS中作为变量引用,不必在JS中拼接字符串)
  • 静态资源发布时,支持文件名MD5
  • livereload 开发中

安装

安装astros-cli

创建项目时,你不必手动创建目录结构,挨个安装nodejs依赖,astros-cli能帮你完成这些工作。

npm install -g astros-cli

创建项目

astros create ~/astros-example

或者直接从 github 获取

git clone [email protected]:lemonabc/astros-example.git
cd astros-example
npm install
npm start

默认端口号是Web服务器端口号是3301,静态资源服务端口号是 3300

工作目录

配置文件

static.js

发布时,会读取static-build.js,可在发布时才引用图片压缩、JS压缩等中间件。

属性|类型|默认值|描述 ----|----|----|---- name|String|default|项目名称 port|Number|3104| 静态资源服务器端口号 root|String||项目根目录 jsExt|String|js|JS文件后缀名 cssExt|String|less|样式文件后缀名 htmlExt|String|html|html文件后缀名 assets|String|site/assets|静态资源目录 webCom|String|site/components|web组件目录 jsCom|String|site/assets/less|js组件目录 cssLib|String|site/assets/less|公共样式类库目录 page|String|root/page|页面存储路径 cache|String|root/_cache|缓存目录 release|String|root/_cache/release|发布目录 img|String|root/assets/img|图片存放目录 imgCache|String|root/_cache/imgcache|图片处理缓存目录 ignore|Array|['jslib', 'less'|发布时要忽略的assets下的目录 middlewares|Array||项目加载的中间件 cdnPrefix|||资源路径修饰符

site.js

属性|类型|默认值|描述 ----|----|----|---- port|String|3100|web服务器端口号 root|String||项目根目录 openTag|String|{{|模板开始标记 closeTag|String|}}|模板结束标记 page|String|root/page|页面存储路径 autoAssets|Boolean|false|支持自动引用页面CSS和JS globalVariable|Object||全局参数

发布时,会读取site-build.js

发布

在项目根目录下,执行

astros build

或者

astros build 项目目录

你可以增加 --html 参数,发布解析后的HTML

更多文档,请访问官网