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

imgcook-node

v1.0.4

Published

支持jpg,png,psd等图片格式 可以将imgCook的json数据转换为web,taro,flutter

Downloads

7

Readme

安装

npm i --save imgcook-node

示例

const imgNode = require('imgcook-node')
const path = require('path')
const co = require('co')

imgNode.init({
    'scanDirectory':path.resolve('./test/'),
    'outDirectory':{
        'flutter':path.resolve('./'),
        'web': path.resolve('./'),
        'taro': path.resolve('./'),
    },
    // 内置了token与cookie 如果cookie过期 请填入自己的cookie
    // 'ctoken':'',
    // 'cookie':''
})
co(function *() {
    yield imgNode.scan()
    yield imgNode.post()
    yield imgNode.buildFlutter()
    yield imgNode.buildWeb()
    yield imgNode.buildTaro()
})

支持功能

输入文件支持jpg png psd 
输出文件类型 支持web taro flutter 
只要指定一个目录 就会自动将图片进行转换成对应平台代码

taro 转换输出

import Taro from "@tarojs/taro"
import { View, Text } from "@tarojs/components"
import styles from "./index.module.less"
export default class Test extends Taro.Component {
  render() {
    return (
      <View className={styles.box}>
        <View className={styles.hd}></View>
        <View className={styles.bd}>
          <View className={styles.layerWrap}>
            <View className={styles.layer}></View>
            <View className={styles.largeIcon}></View>
          </View>
          <View className={styles.entryPic}></View>
        </View>
        <View className={styles.row}>
          <View className={styles.pic}></View>
          <View className={styles.item}></View>
          <View className={styles.img}></View>
          <View className={styles.itemLong}></View>
        </View>
        <View className={styles.submain}>
          <View className={styles.productLong}></View>
          <View className={styles.itemLong_2}></View>
          <View className={styles.block}>
            <View className={styles.entryPic_2}></View>
            <View className={styles.entryPic_3}></View>
          </View>
        </View>
        <View className={styles.main}></View>
      </View>
    )
  }
}

web 转换输出

import React, { Component } from "react"
import styles from "./index.less"
export default class Test extends Component {
  render() {
    return (
      <div className={styles.block}>
        <div className={styles.largeItem}></div>
      </div>
    )
  }
}

flutter 转换输出

import 'package:flutter/material.dart';
import 'package:rlstyles/main.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class TestView extends StatefulWidget {
  TestView({Key key, this.navigation}) : super(key: key);
  final NavigationOption navigation;
  _TestState createState() => _TestState();
}

class _TestState extends State<TestView> {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.instance = ScreenUtil(width: 750, height: 750);
    return View(styles: styles['block'], className: 'block', children: [
      View(styles: styles['largeItem'], className: 'largeItem', children: [])
    ]);
  }
}

const Map<String, Styles> styles = {
  "block": Styles(
    display: "flex",
    alignItems: "flex-start",
    flexDirection: "row",
    borderRadius: 165,
    backgroundColor: "#000000",
    width: 750,
    height: 750,
    overflowY: "scroll",
  ),
  "largeItem": Styles(
    width: 750,
    height: 750,
  ),
};

flutter ui 组件库介绍

rlstyles 里面有详细的参数说明

未来功能规划

这版本功能做完以后 下阶段目标为用flutter实现一个小程序内核框架
目标是将现有的taro或者vue小程序项目 直接flutter跑起来
可以使用小程序方式来做热更新