Skip to content

Update example for module  #4

Description

@crystalfp

Just a minor point. I tried the example from README and it complains as below because the project has "type" = "module". Adding a note to the example could be sufficient.

import { RingBuffer } from 'ring-buffer-ts';
         ^^^^^^^^^^
SyntaxError: Named export 'RingBuffer' not found. The requested module 'ring-buffer-ts' is a
CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'ring-buffer-ts';
const { RingBuffer } = pkg;

Thanks!
mario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions