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

nejc

v1.5.1

Published

nej => commonjs

Downloads

12

Readme

NejC

Build Status

NejC 是一个 nej => commonjs 规范的大胆尝试,目前还在密集开发阶段。

介绍

查看 介绍

如何体验

一、CLI 式

Step 1. 安装 NejC 到全局

$ npm i --global nejc

Step 2. 根据 文档 编写一个符合你需求的 nejc.config.js

$ cd /path/to/project
$ touch nejc.config.js # 创建 nejc.config.js
const path = require('path')
module.exports = {
    'src': 'src/mobileweb-helper', // 输入文件夹 或 文件
    'dist': 'build/node_modules/mobileweb-helper', // 输出文件夹
	'ext': ['.js'],
	'libs': [ 
	    // 添加到 libs 下的包名,不会做路径转换;
	    // 否则会识别成 nej "base/element" 的形式 
    	'mobileweb-helper',
        'mobileweb-ui',
        'mobileweb-mcss',


        'regularjs',
        'iscroll',
        'hammerjs',
        'html2canvas'
    ],

    'replaceArgs': { 
        // 由于 nej 模块加载规范是自己的风格
        // 所以我们一般在使用时会用 placeholder 代替
        // 这个操作是将 placeholder 替换成暴露到 windows 上的变量
    	'regularjs': 'Regular',
    	'hammerjs': 'Hammer',
        'html2canvas': 'html2canvas'
    },
    
    'alias': {
        // 输入别名 => 将匹配 key 的模块名替换成 value (value为物理路径)
        'lib': path.join(__dirname, 'nej')
    },
    
    'outputAlias': {
        // 输出别名 => 将匹配 value 的路径别名成对应的 key
        'nej-commonjs': path.join(__dirname, 'nej')
    },
    
    'mode': 2,
    
    'features': ['arrow', 'for-of', 'for-each', 'arg-rest', 'arg-spread', 'obj-method', 'obj-shorthand', 'no-strict', 'exponent', 'multi-var'],
    
    'plugins': [
        function (source) {
            return source.replace(/\.\_\$bind/g, '.bind');
        }
    ]
}

Step 3. 执行 nejc,并静静等待

$ nejc

二、Gulp Plugin 式

Step 1. 安装 NejC 到工程

$ cd /path/to/project
$ npm i --save nejc

Step 2. 根据 文档 编写一个符合你需求的 配置 gulpfile.js

const gulp = require('gulp');
const nejc = require('../index');
const path = require('path');
const config = {
    /**
     * Here is nejc.config.js
     */
}

gulp.task('default', function () {
    return gulp
        .src(config.src)
        .pipe(nejc(config))
        .pipe(gulp.dest(config.dist));
});

Step 3. 执行 Gulp 并静默等待

$ cd /path/to/project
$ gulp

关于贡献代码

  1. 在 Issues 栏中新建一个 Issue
  2. Fork 本仓库
  3. 新建分支,并 commit 你的代码,commit title 是 fix #${Issue Number}
  4. Pull request

All done

关于输出

LICENSE

license