Skip to content

CLI commands with object results print js-but-not-json #12

Open
@sparr

Description

@sparr
> storage.db['rooms.objects'].find({room: 'W1N7', type: 'controller'})
[ { room: 'W1N7',
    type: 'controller',
    x: 41,
    y: 31,
    level: 0,
    _id: 'fd2c0774d801520',
    meta: { revision: 0, created: 1477476568448, version: 0 },
    '$loki': 239 } ]

It would be a lot easier to have other programs interact with the CLI if this response was valid JSON instead of just valid JS. I think the only change would be to use double quotes, and to quote the keys.

This could be a problem with lokijs. I wasn't able to follow the behavior of the CLI code far enough to find out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions