npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yu-speed-csv-to-mongodb

v0.1.0

Published

yu-speed-csvToMongoDB is a csv to MongoDB Command-line app

Downloads

2

Readme

YuSpeed csvToMongoDB

About YuSpeed csvToMongoDB

The csvToMongoDB is a a high memory efficient flexible and extendable open-source CSV import to mongoDB command-line app for Node js. The import using mongoimport.

Features

1. Memory Management Free

This library was designed for low memory usage. It will not accumulate all the rows in the memory. The importer reads a CSV file and executes a callback function line by line.

2. Directory support

This library supports import all files in a directory.

3. Watch support

This library supports watch a directory.Import auto begin when file enter the directory.

Requirements

  • Node js 8.3 or later
  • MonggoDB mongoimport

Getting started

install from NPM:

npm install --save yu-speed-csvToMongoDB

or using yarn

yarn add yu-speed-csvToMongoDB

First running

yuCsvToDB

input item follow prompt. The result will save to app.json and will used after running.

? Please enter your monggoDB hostname localhost
? Please enter your monggoDB port 27017
? Please enter your database name users
? Please enter your collection name ticks
? Please enter your username admin
? Please enter your password [hidden]
? Please enter a import pattern that search csv file. f:/history/data/tick/*.csv
? Please enter the shell command mongoimport path D:/MongoDB/Server/3.4/bin/
? Please enter the backup path f:/history/backup/tick
? Please confirm your input:
{
  "hostname": "localhost",
  "port": 27017,
  "database": "users",
  "collection": "ticks",
  "username": "admin",
  "password": "1",
  "pattern": "f:/history/data/tick/*.csv",
  "mongoimportPath": "D:/MongoDB/Server/3.4/bin/",
  "backupPath": "f:/history/backup/tick"
} Yes

import

yuCsvToDB -i

output on console


  start import file a1801_1505721922380.csv(2.75MB) estimate 0.02minute.
 
       2017-09-20T07:42:36.377+0800      connected to: localhost:27017
       2017-09-20T07:42:37.478+0800      imported 39769 documents
 
  The file be moved to f:/history/backup/tick
 
 
  start import file a1801_1505723904360.csv(132.39MB) estimate 0.77minute.
 
       2017-09-20T07:42:37.653+0800      connected to: localhost:27017
       2017-09-20T07:42:40.649+0800      [#.......................] users.ticks  7.13MB/132MB (5.4%)
       2017-09-20T07:42:43.648+0800      [##......................] users.ticks  14.9MB/132MB (11.2%)
       2017-09-20T07:42:46.649+0800      [####....................] users.ticks  23.6MB/132MB (17.8%)
       2017-09-20T07:42:49.649+0800      [######..................] users.ticks  33.1MB/132MB (25.0%)
       2017-09-20T07:42:52.649+0800      [#######.................] users.ticks  43.1MB/132MB (32.6%)
       2017-09-20T07:42:55.649+0800      [########................] users.ticks  49.6MB/132MB (37.4%)
       2017-09-20T07:42:58.650+0800      [##########..............] users.ticks  56.4MB/132MB (42.6%)
       2017-09-20T07:43:01.649+0800      [###########.............] users.ticks  64.4MB/132MB (48.7%)
       2017-09-20T07:43:04.649+0800      [#############...........] users.ticks  74.1MB/132MB (56.0%)
       2017-09-20T07:43:07.648+0800      [###############.........] users.ticks  84.9MB/132MB (64.1%)
       2017-09-20T07:43:10.649+0800      [#################.......] users.ticks  95.4MB/132MB (72.1%)
       2017-09-20T07:43:13.649+0800      [###################.....] users.ticks  105MB/132MB (79.2%)
       2017-09-20T07:43:16.650+0800      [####################....] users.ticks  115MB/132MB (87.0%)
       2017-09-20T07:43:19.648+0800      [######################..] users.ticks  126MB/132MB (94.8%)
       2017-09-20T07:43:21.582+0800      [########################] users.ticks  132MB/132MB (100.0%)
       2017-09-20T07:43:21.582+0800      imported 1967782 documents
 
  The file be moved to f:/history/backup/tick
 
  Pattern:  -  2 matches
  Total size:   135.14MB
  Done in 0.76minute

watch

yuCsvToDB 

reset app.json

yuCsvToDB -r

API documentation

YuSpeed csvToMongoDB is fully documented via inline JSDoc comments. The docs are also available online. When using an IDE like Intellij IDEA or Webstorm the docs are available inline right inside your editor.

License

MIT ©