Code Monkey home page Code Monkey logo

sheet-cli's Introduction

Sheet-cli

A simple csv and xlsx spreadsheet viewer that works in a similar manner to less.

How to install

npm install --global sheet-cli

Usage

This utility relies on the extension name to be either csv for a csv file or xlsx for excel documents. Simply specify the file to open as the first argument. If you are opening an excel file you can specify the name of the sheet to select. Otherwise it will select the first one in the document.

sheet-cli file [sheet]

Hotkeys

Arrow keys work, and at the moment b for doing up half a page and d for going down half a page.

To quit the program, simply press q.

Limitations / Known Issues

  • Mouse support seems to be broken in blessedjs. Currently there is no scrolling support.
  • Merged cells aren't handled properly.

sheet-cli's People

Contributors

aghost-7 avatar

Stargazers

Evan Oman avatar Matthew Pengelly avatar Sully D Sheets avatar

Watchers

James Cloos avatar  avatar

sheet-cli's Issues

Scrolling issues with XLSX files

Very neat project! With small worksheets the current version throws an error:

/usr/local/lib/node_modules/sheet-cli/index.js:21
			return formattingMappings[cell.type](cell.value)
			                                    ^

TypeError: formattingMappings[cell.type] is not a function
    at row.map (/usr/local/lib/node_modules/sheet-cli/index.js:21:40)
    at Array.map (native)
    at sheet.rows.map (/usr/local/lib/node_modules/sheet-cli/index.js:20:14)
    at Array.map (native)
    at formatData (/usr/local/lib/node_modules/sheet-cli/index.js:19:20)
    at exports.display (/usr/local/lib/node_modules/sheet-cli/index.js:27:15)
    at exports.main (/usr/local/lib/node_modules/sheet-cli/index.js:58:2)
    at Object.<anonymous> (/usr/local/lib/node_modules/sheet-cli/index.js:62:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)

With large worksheets, scrolling beyond the end to the right throws:

TypeError: Cannot read property 'toString' of null
    at row.map (/usr/local/lib/node_modules/sheet-cli/lib/table.js:338:32)
    at Array.map (native)
    at slice.map (/usr/local/lib/node_modules/sheet-cli/lib/table.js:338:14)
    at Array.map (native)
    at TableRenderer.proto.render (/usr/local/lib/node_modules/sheet-cli/lib/table.js:337:15)
    at Box.<anonymous> (/usr/local/lib/node_modules/sheet-cli/lib/table.js:401:30)
    at Box.EventEmitter._emit (/usr/local/lib/node_modules/sheet-cli/node_modules/blessed/lib/events.js:94:20)
    at Box.EventEmitter.emit (/usr/local/lib/node_modules/sheet-cli/node_modules/blessed/lib/events.js:117:12)
    at Program.<anonymous> (/usr/local/lib/node_modules/sheet-cli/node_modules/blessed/lib/widgets/screen.js:602:15)
    at emitTwo (events.js:106:13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.