Socket
Socket
Sign inDemoInstall

file_operator_sf

Package Overview
Dependencies
7
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    file_operator_sf

the file operator


Version published
Maintainers
1
Created

Readme

Source

fileOperator

file operator.

read and write file.
support csv/xlsx file format. default csv.
support gbk/utf-8 file encoding. default utf-8.

api

  • read file.

pass absolute file path and file encoding.

const operator = require('file_operator_sf');
let data = operator.read(path.join(__dirname, <filepath>), [encoding='utf-8']);
  • write file.

pass absolute file path, data and file encoding.

const operator = require('file_operator_sf');
operator.write(path.join(__dirname, <filepath>), data, [encoding='utf-8']);

data format to write.

String
'this is the data to write.'

Object
{
  attr1: value1,
  attr2: value2
}

Array
['this is another word.', 'this is a word.']
[['attr1', 'attr2'], [value1, value2]]
[{
  attr1: value1,
  attr2: value2
},
{
  attr1: value1,
  attr2: value2
}]

Keywords

FAQs

Last updated on 07 Nov 2016

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