1.0.19 • Published 1 year ago

@mskii/csv-file v1.0.19

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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 ライセンス の下で公開されています。

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.11

1 year ago

1.0.12

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago