# am-xlsx2json


Converting xlsx file to json files using nodejs (js-xlsx)

## Install

```
  npm install https://repo.aksimaya.id/aksimaya/am-xlsx2json.git
```

## Usage

```javascript
  am_xlsx2json = require("am-xlsx2json");
  am_xlsx2json({
    input: "sample.xlsx", // path of excel file / uploaded file
    output: "output.json" // if  set  it will write to file
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  });
```

### Specifying a target sheet

You can optionally provide a sheet name to extract from that sheet

```javascript
  am_xlsx2json = require("am-xlsx2json");
  am_xlsx2json({
    input: "sample.xlsx", // path of excel file / uploaded file
    output: "output.json" // if  set  it will write to file
    sheet: "tags"
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  });
```

In config object, you have to enter an input path. But If you don't want to output any file you can set to `null`.

## License