@activeprospect/indexer

中文文档
1.3.6发布于 2022/05/17MIT零依赖近 30 天下载 1854

Exposes a directory of javascript or coffeescript files as a module indexed by file name

原始使用文档
文档目录3 节
  1. Indexer
  2. Usage
  3. Reference

Indexer

This Node.JS module requires a directory of JavaScript (or CoffeeScript) files and makes the associated modules available. It can be used to extend a specified module.

Build Status

Usage

Assume the following directory structure:

zoo
|-- ape.js
|-- donkey.js
|-- zebra.js

Add an index file (zoo/index.js) which delegates to the indexer module:

var path = require('path');

var index = require('indexer');

// index all the files in the same directory and extend this module
index(__dirname, module);

Then to use the zoo module:

var zoo = require('zoo');

zoo.ape    // returns the module defined in zoo/ape.js
zoo.donkey // returns the module defined in zoo/donkey.js
zoo.zebra  // returns the module defined in zoo/zebra.js

Reference

This module exports a single function with the following parameters:

  • dirname — the directory of files to index (.js and .coffee files will be indexed)
  • module — (optional) export each module in dirname to this module.
  • ignoreModules — the rest of the parameters passed to the function are module names to ignore (i.e. index(__dirname, module 'ape', 'donkey') will only export the zebra module)

The object returned by the function has a property for each module in the dirname.

版本与发布记录

@activeprospect/indexer 共发布 14 个版本,首次发布于 2015/05/05;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.3.6latest2022/05/174 年前
1.3.52021/03/245 年前
1.3.42020/03/036 年前
1.3.32019/10/177 年前
1.3.22019/08/237 年前
1.3.12015/07/0911 年前

关于 @activeprospect/indexer 的常见问题

@activeprospect/indexer 是什么?

Exposes a directory of javascript or coffeescript files as a module indexed by file name

如何安装 @activeprospect/indexer?

在项目目录运行 npm install @activeprospect/indexer,或使用 pnpm add / yarn add / bun add。

@activeprospect/indexer 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/activeprospect__indexer 是否存在。

@activeprospect/indexer 可以商用吗?

@activeprospect/indexer 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@activeprospect/indexer 的下载量有多少?

根据 npm 官方下载统计,@activeprospect/indexer 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,854 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@activeprospect/indexer 还在维护吗?

最新版本 1.3.6 发布于 2022/05/17(4 年前);至今共发布 14 个版本,其中过去 12 个月发布了 0 个;首次发布于 2015/05/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。