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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wis-helper-js

v1.0.1

Published

# 介绍 该组件是解析wis文件 获取曲线信息和表信息和流数据,具体使用方法如下:

Readme

wis 文件解析

介绍

该组件是解析wis文件 获取曲线信息和表信息和流数据,具体使用方法如下:

使用方式

  • 使用npm安装包
    npm install wis-helper-js
  • 使用pnpm安装包
    pnpm install wis-helper-js
  • 使用yarn安装包
    yarn add wis-helper-js

具体方法使用


| 方法名称              | 方法作用                    |
| -------------------- | -------------------------- |
| parseHead            | 获取头信息                  |
| parseObjectNames     | 获取曲线、表格、流名称        |
| parseCurves          | 获取解析曲线数据            |
| parseTables          | 获取解析表格数据            |
| parseStream          | 获取解析流数据              |
| bytesToString        | 获取流内容转换成文本         |
  • 1、在使用的组件中引入

  import { WisHelper } from 'wis-helper-js'
  
  • 2、初始化加载

其中wisFile为input file 对象

    // 其中wisFile为input file 对象
    const wisReader = new WisHelper(wisFile)
    await wisReader.readFile()
    
  • 3、获取头信息

  const head = wisReader.parseHead();
  console.log(head)
  
  • 4、获取曲线、表格、流名称

  const curvesAndTables = wisReader.parseObjectNames();
  // 获取曲线名称列表
  const curveNames = curvesAndTables[0]
  // 获取表格名称列表
  const tableNames = curvesAndTables[1]
  // 获取流名称列表
  const streamNames = curvesAndTables[2]
  
  • 5、解析曲线数据

字段
/**   曲线数据结构字段解释
  * id 曲线id
  * aliasName 曲线别名
  * aliasUnit 曲线单位别名
  * dataOffset 数据偏移量
  * dim 曲线维度
  * dimAliasName 曲线维度别名
  * dimName 曲线维度名称
  * dimRepCode 曲线维度值类型
  * dimUnit 曲线维度单位
  * maxVal 曲线缺省最大值
  * minVal 曲线缺省最小值
  * name 曲线名称
  * pointNum  深度点数
  * secondDimNum  第二维度点数
  * start 起始深度
  * stop 终止深度
  * unit 曲线单位
  * step 采样间隔
  * valueRepCode 曲线数据代码类型
  * depths 曲线深度数组
  * values 曲线深度值数组 (一为数组和二位数组   取决于 dim 曲线维度)
  */
  

  /**
  * @param curveType 曲线类型(ci:曲线索引 cd:曲线数据, ca:曲线索引+数据, 缺省为null,即是ca)
  * @param filterNames 过滤的曲线名称 (Name1,Name2,... , 缺省为null,即是全部曲线)
  */
 // 解析某个曲线和多个曲线
 const curves = wisReader.parseCurves(curveType,filterNames);
 // 解析曲线全部数据
 const curves = wisReader.parseCurves();
 
  • 6、解析表格数据

  字段
  /**  表格数据结构字段解释
  * id id
  * fieldCount 当前表格名称数量
  * fields  当前表格数据表头信息
  *     name 头部名称
  *     code 头部代码     
  *     length 头部长度
  * name 表格名称
  * recordCount 当前数据表数量
  * records 当前数据表列表
  *     这个里面的数据对应 fields里面的数据
  */
  

  /**
  * @param tableType 表格数据(ti:表格索引 td:表格数据, ta:表格索引+数据, 缺省为null,即是ta)
  * @param filterNames 过滤的表格名称 (Name1,Name2,... , 缺省为null,即是全部曲线)
  * @param format 表格数据输出类型(1、json, 2、 array, 可不传默认值为 json)
  */
  // 条件过滤表格数据调用形式
  const tableData = wisReader.parseTables(tableType,filterNames,format);
  console.log(tableData)
  // 全部表格数据加载形式
  const tableData = wisReader.parseTables();
  console.log(tableData)
  
  • 7、解析流数据

字段
/**  流数据字段解释
  * id id
  * name 名称
  * content 流内容
  */
  

  /**
  * 此方法不需要传参
  * 获取后是一个数组,每个元素都是一个流对象
  */
  let streams = wisReader.parseStream()
  console.log(streams[0].content) //流对象