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

ios-icon

v0.0.2

Published

根据一张1024X1024的图片,自动生成iOS的需要的icon,并自动创建Contents.json,支持命令行调用.

Downloads

8

Readme

ios-icon

根据一张1024X1024的图片,自动生成iOS的需要的icon,并自动创建Contents.json,支持命令行调用。

这是一个自用项目,起因是我每次做icon都要保存为不同的规格,icon如果有调整又要生成全部生成。想到Photoshop的动作或者脚本又没找到,node.js也有类似的库,但我没有发现支持Xcode5的。

所以,我希望有一个工具,能根据1024的icon,自动创建所有规格的icon,并规范命名,同时生成Contents.json文件。

既然没有,我就自己写一个吧,花了一个早上,弄了一个自动化工具,算是自用工具吧。代码有点乱码,属于赶工产品,希望这不是一个太重复的轮子。

目前只支持Xcode 5+,即Images.xcassets的方式,对于Xcode 5以下的版本,生成图标也是有用的,只不过,没有这么自动化,有兴趣的可以fork一下。

欢迎Pull Request和Star。

#Install

  1. ios-icon使用了imagemagick,如果你还没有安装,在OSX中,你可以使用brew install imagemagick安装。
  2. 你必需安装好node.js环境(废话)
  3. npm install -g ios-icon,建议使用-g全局安装

如果你没有安装imagemagick,则可能会出现这样的错误:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)

PS. 最好从github安装,npm有可能不是最新的,尽量做到同步吧。

#Usage

  1. 保存一个1024的icon,并cd到icon所在的目录,建议先将icon保存到Images.xcassets/AppIcon.appiconset目录
  2. 使用ios-icon,即可生成Contents.json配置文件以及相应的icon
  3. 也可以使用-i与'-o'来指定icon文件与输出目录。如:ios-icon -i <icon path> -o <output path>

Credits

License

The MIT License

Copyright (c) 2012-2013 Conis Yi <http://iove.net/>