Skip to content

ZakMiller/types-from-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Types From CSV

Overview

types-from-csv is a package I wrote to help me infer SQL types given a CSV file. It's very rudimentary. It takes in the path to a CSV and returns a list of objects of the form:

[
    {name: 'columnOneName', type: 'bit'},
    {name: 'columnTwoName', type: 'date'},
    {name: 'columnThreeName', type: 'char'},
    {name: 'columnFourName', type: 'number'},
    {name: 'columnFiveName', type: 'string'}
]

Currently, it only detects those types. 'string' is the fallback if nothing else matches.

Usage

const csvTypes = require('types-from-csv');

csvTypes.getTypesFromCSV('your-path.csv')
    .then(d => {
        console.log(d);
    });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published