@gmod/nclist

中文文档
3.0.15发布于 2026/10/09MITTypeScriptESM + CJS构建来源已验证近 30 天下载 3.2万

Read features from JBrowse 1 format nested containment list JSON

原始使用文档
文档目录5 节
  1. Status
  2. Usage
  3. API
  4. NCListStore
  5. Publishing

nclist-js

Read legacy JBrowse 1 nested containment list JSON.

Status

Build Status Coverage Status NPM version

Usage

import { RemoteFile } from 'generic-filehandle2'
import NCList from '@gmod/nclist'
;(async () => {
  const store = new NCList({
    baseUrl: `http://my.server/path/to/data/dir/`,
    urlTemplate: 'volvox_genes/{refseq}/trackData.json',
    readFile: url => new RemoteFile(url).readFile(),
  })

  for await (const feature of store.getFeatures({
    refName: 'ctgA',
    start: 0,
    end: 50000,
  })) {
    console.log(
      `got feature at ${feature.get('seq_id')}:${feature.get(
        'start',
      )}-${feature.get('end')}`,
    )
  }
})()

API

Table of Contents

NCListStore

Sequence feature store using nested containment lists held in JSON files that are lazily read.

Parameters

  • args object constructor args
    • args.baseUrl string base URL for resolving relative URLs
    • args.urlTemplate string Template string for the root file of each reference sequence. The reference sequence name will be interpolated into this string where {refseq} appears.
    • args.readFile function function to use for reading remote from URLs.
    • args.cacheSize (optional, default 10)

getRegionFeatureDensities

fetch binned counts of feature coverage in the given region.

Parameters
  • query object
    • query.refName string reference sequence name
    • query.start number region start
    • query.end number region end
    • query.numBins number number of bins desired in the feature counts
    • query.basesPerBin number number of bp desired in each feature counting bin

Returns object as: { bins: hist, stats: statEntry }

getFeatures

Fetch features in a given region. This method is an asynchronous generator yielding feature objects.

Parameters
  • args object
    • args.refName string reference sequence name
    • args.start number start of region. 0-based half-open.
    • args.end number end of region. 0-based half-open.

Publishing

Trusted publishing via GitHub Actions.

pnpm version patch  # or minor/major

版本与发布记录

@gmod/nclist 共发布 23 个版本,首次发布于 2019/04/21;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.15latest2026/10/091 个月前
3.0.142026/08/222 个月前
3.0.132026/08/113 个月前
3.0.122026/08/113 个月前
3.0.112026/07/253 个月前
3.0.102026/05/195 个月前

关于 @gmod/nclist 的常见问题

@gmod/nclist 是什么?

Read features from JBrowse 1 format nested containment list JSON

如何安装 @gmod/nclist?

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

@gmod/nclist 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gmod/nclist 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gmod/nclist 可以商用吗?

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

@gmod/nclist 的下载量有多少?

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

@gmod/nclist 还在维护吗?

最新版本 3.0.15 发布于 2026/10/09(1 个月前);至今共发布 23 个版本,其中过去 12 个月发布了 10 个;首次发布于 2019/04/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。