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

@wox/loader

v1.0.16

Published

The loader module of wox

Downloads

7

Readme

@wox / loader

wox规范架构加载器。分serverclient端的解析引擎。

Install

npm i @wox/loader

Usage

serviceclient端的解析引擎。

import Server from '@wox/loader/server';
import Client from '@wox/loader/client';

server端主要用于webpack的插件化,解决自动loader文件夹的策略。client主要对server端解析的数据进行规范解析。同时提供插件化能力。

Server

创建webpack插件化对象,它有一个参数,布尔值,表示是否开启监听。

import WoxWebpackRuntimePlugin from '@wox/loader/server';
const wox = new WoxWebpackRuntimePlugin(true);
wox.addDictionary(__dirname);
wox.loadCommonCase();

以后你可以将wox放置到webpack的plugins中。

var webpack_options = {
  plugins: [
    wox,
  ]
}

wox.loadCommonCompiler

注入一个通用的编译器

wox.loadCommonCompiler(code, rule, deep);
// code: {string} 编译器标识名
// rule: {array} 路径解析规范  来源于 'ignore' 组件
// deep: {number} 解析深度 默认:2

wox.addCompiler

添加一个编译器

wox.addCompiler(compiler);
// compiler: {function} 编译器内容回调

wox.setParser

设置一个基于编译器的一个解析器

wox.setParser(code, callback);
// code: {string} 编译器标识名
// callback: {function} 处理的回调函数
// callback拥有2个参数(id, filePath) 返回值决定编译的最终内容

wox.addDictionary

添加一个新的编译文件夹地址

wox.addDictionary(__dirname__);

wox.extract

抽取文件的内容到固定文件

wox.extract();

wox.exit

退出编译

wox.exit();

Plugin maker

在插件中如果存在.wox.js文件,那么它将被程序调用,用来处理插件的自定义server端行为。