0.1.2 • Published 8 years ago

node-data-binder v0.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

node-data-binder

データをタコ足配線的にまとめる

Install

$ npm install node-data-binder

Description

サポートされたフォーマットのデータを JS に変換してオブジェクトにまとめます。
(.json .json5 .js .txt .xml .csv)

data/
    ├── status.json
    ├── package.json5
    ├── books.xml
    ├── number.csv
    ├── readme.txt
.
.
.
↓

data: {
  status : {
    [status.json]
  },
  books: {
    [books.xml -> Js]
  },
  number: {
    [number.csv -> Js]
  },
  readme: {
    [readme.txt -> Js]
  }
}

Usage

const binder = require('node-data-binder');

let data = binder({
  dir: './data',      // データがあるディレクトリまでのパス
  keyWithExt: false   // キー名に拡張子を含めるかどうか
});

console.log('[data]', data);

Todo

  • word excel サポートする?
  • cson eson サポートする?

License

MIT