Socket
Socket
Sign inDemoInstall

@mosuke_mkii/csv-file

Package Overview
Dependencies
8
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mosuke_mkii/csv-file

CSVファイルを操作するモジュール


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
2.31 MB
Created
Weekly downloads
 

Readme

Source

CsvFile

CsvFile は、Node.js で CSV ファイルを簡単に扱うためのモジュールです。
CSV ファイルの読み込み、書き込み、行の追加などの機能を提供します。

機能

  • CSV ファイルの新規作成とヘッダーの追加
  • 既存の CSV ファイルへの行の追加
  • CSV ファイルの読み込みとオブジェクトへの変換
  • ヘッダーの検証
  • 特定のカラムの値に基づく行の集計
  • 特定の文字列を含む行の削除

インストール

npm install @mosuke_mkii/csv-file

使い方

以下は CsvFile モジュールの基本的な使用例です:

const CsvFile = require('@mosuke_mkii/csv-file');

(async () => {
  // CSVファイルの新規作成とヘッダーの追加
  const csvFile = new CsvFile({
    headers: ['Name', 'Age', 'Gender'],
    path: 'example.csv'
  });
  await csvFile.createOnlyHeader();

  // 既存のCSVファイルへの行の追加
  await csvFile.append([
    ['John Doe', '30', 'Male'],
    ['Jane Doe', '25', 'Female']
  ]);

  // CSVファイルの読み込みとオブジェクトへの変換
  const rows = await csvFile.convertCsvToArray();
  console.log(rows);
  /*
  output:
    [
      { Name: 'John Doe', Age: '30', Gender: 'Male' },
      { Name: 'Jane Doe', Age: '25', Gender: 'Female' }
    ]
  */
})();

ライセンス

このプロジェクトは MIT ライセンス の下で公開されています。

Keywords

FAQs

Last updated on 08 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc