Coder Social home page Coder Social logo

atom-bson-converter's Introduction

bson-converter

apm apm apm Travis David

Converts BSON into JSON (or CSON) and vice versa

Installation

apm

Install bson-converter from Atom's Package Manager or the command-line equivalent:

$ apm install bson-converter

Using Git

Change to your Atom packages directory:

# Windows
$ cd %USERPROFILE%\.atom\packages

# Linux & macOS
$ cd ~/.atom/packages/

Clone the repository as bson-converter:

$ git clone https://github.com/idleberg/atom-bson-converter bson-converter

Install dependencies:

cd bson-converter && npm install

Usage

Once installed, two commands are exposed to the command palette:

  • BSON: Encode – encodes JSON and CSON into BSON
  • BSON: Decode – decodes BSON into JSON or CSON

You can tweak the behavior by adjusting the many options available in the package settings.

Keyboard Shortcuts

The following examples use the macOS keyboard shortcuts. On Linux or Windows use Shift+Super as modifier key

Memorizing the keyboard shortcuts for conversion is easy. Just think of the B key for BSON, the J key for JSON:

Action Mnemonic Shortcut
BSON to JSON (or CSON) “B to J” Ctrl+Cmd+B, Ctrl+Cmd+J
JSON (or CSON) to BSON “J to B” Ctrl+Cmd+J, Ctrl+Cmd+B

License

This work is licensed under the The MIT License.

atom-bson-converter's People

Contributors

idleberg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

atom-bson-converter's Issues

Uncaught Error: Cannot find module 'bson'

[Enter steps to reproduce:]

  1. Open any BSON file
  2. Use command "BSON decode"

I've used GIT installation from README.md instructions. Atom had been restarted several times, but error is still thrown.

Atom: 1.28.0 x64
Electron: 2.0.3
OS: Unknown Windows version
Thrown From: bson-converter package 0.4.2

Stack Trace

Uncaught Error: Cannot find module 'bson'

At module.js:545

Error: Cannot find module 'bson'
    at Module._resolveFilename (module.js:543:15)
    at Module._resolveFilename (~/AppData/Local/atom/app-1.28.0/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (~/AppData/Local/atom/app-1.28.0/resources/app/src/module-cache.js:354:58)
    at Module.require (/app.asar/static/index.js:40:43)
    at require (~/AppData/Local/atom/app-1.28.0/resources/app/src/native-compile-cache.js:66:33)
    at Object.encode (/packages/bson-converter/lib/bson-converter.coffee:133:12)
    at /packages/bson-converter/lib/bson-converter.coffee:121:79)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.28.0/resources/app/src/command-registry.js:384:49)
    at Object.didConfirmSelection (~/AppData/Local/atom/app-1.28.0/resources/app/node_modules/command-palette/lib/command-palette-view.js:152:35)
    at SelectListView.confirmSelection (~/AppData/Local/atom/app-1.28.0/resources/app/node_modules/atom-select-list/src/select-list-view.js:401:26)
    at SelectListView.didClickItem (~/AppData/Local/atom/app-1.28.0/resources/app/node_modules/atom-select-list/src/select-list-view.js:287:16)
    at ListItemView.onclick (~/AppData/Local/atom/app-1.28.0/resources/app/node_modules/atom-select-list/src/select-list-view.js:222:37)
    at ListItemView.didClick (~/AppData/Local/atom/app-1.28.0/resources/app/node_modules/atom-select-list/src/select-list-view.js:449:16)

Commands

     -2:40.3.0 application:open-file (atom-pane.pane.active)
     -1:21.9.0 command-palette:toggle (input.hidden-input)
     -1:16.7.0 BSON:decode (input.hidden-input)
     -0:47.6.0 core:select-all (input.hidden-input)
     -0:44.7.0 command-palette:toggle (input.hidden-input)
     -0:41.2.0 BSON:encode (input.hidden-input)

Non-Core Packages

bson-converter 0.4.2 

Uncaught SyntaxError: Unexpected token  in JSON at position 0

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.32.2 x64
Electron: 2.0.9
OS: Mac OS X 10.14.1
Thrown From: bson-converter package 0.5.0

Stack Trace

Uncaught SyntaxError: Unexpected token � in JSON at position 0

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html:1

SyntaxError: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.encode (/packages/bson-converter/lib/bson-converter.coffee:144:21)
    at /packages/bson-converter/lib/bson-converter.coffee:121:79)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:347327)
    at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1227611)
    at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1223745)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:282763)

Commands

     -0:34.1.0 BSON:decode (input.hidden-input)
     -0:27.3.0 core:select-all (input.hidden-input)
     -0:20.4.0 BSON:encode (input.hidden-input)

Non-Core Packages

bson-converter 0.5.0 

bson-converter Error

bson-converter
Error: One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00

Once i try to decode a bson file.

Thanks!

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.