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

module-compiler

v0.0.7

Published

kissy module compiler

Downloads

7

Readme

ModuleCompiler

包括了一些常用的打包工具,java to nodejs

安装

npm install module-compiler

or

git clone git://github.com/daxingplay/ModuleCompiler.git

ModuleComplier

Example:

var ModuleComplier = require('tbuild').ModuleComplier;

// 这里和KISSY.config一样,先配置包
ModuleComplier.config({
    packages: [{
        'name': 'sh',
        'path': '这里建议写绝对路径',
        'charset': 'gbk'
    }]
});

ModuleComplier.build('xxx.js', 'xxx.combine.js');

API:

ModuleComplier.config(cfg);
ModuleComplier.build(inputPath, outputPath);
  • cfg:{Object} 参数

    • packages:{Array} KISSY的包。参见:http://docs.kissyui.com/1.2/docs/html/api/seed/loader/add.html#packages
    • suffix:{String} 输出的文件名后缀,不带.js,比如打包后你想输出为xxx.combine.js,那么这里就配置为:.combine,
    • map: {Array} 类似于KISSY的map方法,可以自己定义把模块名中的路径进行替换,比如把header/abc这个模块名替换为header/cdef,就应该这么配置:map: [['header/abc', 'header/cdef']];map可以叠加
    • charset: {String} 配置输出的编码
  • inputPath: {String} 需要打包的文件路径或者目录

  • outputPath: {String} 需要输出的文件路径

Advanced Example:

var ModuleComplier = require('tbuild').ModuleComplier;

// 这里和KISSY.config一样,先配置包
ModuleComplier.config({
    packages: [{
        'name': 'app1',
        'path': '这里写绝对路径',
        // 这里是指app1这个包源码的编码
        'charset': 'gbk'
    }, {
        'name': 'app2',
        'path': 'app2的绝对路径',
        // 这里是指app2这个包源码的编码
        'charset': 'utf-8'
    }],
    map: [
        // 这样配置的话,那么,如果原先输出的app1的模块名中含有app1/2.0/字样的话,就会被替换成app1/19891014/
        ['app1/2.0/', 'app1/19891014/']
    ],
    // 这里设置的是最后打包出来的文件的编码
    charset: 'gbk'
});

ModuleComplier.build('xxx.js', 'xxx.combine.js');

License

遵守 "MIT":https://github.com/daxingplay/ModuleCompiler/blob/master/LICENSE.md 协议