Skip to content

loading packets... #64

Closed
Closed

Description

@DevCobe

is ther another way to load packets instead of this way
const {
InSimFlags,IS_BTC, IS_MST,IS_SCC,IS_CPR, IS_TINY, IS_SMALL, TinyType,PacketType, RaceState
} = require('node-insim/packets');

Activity

  1. mkapal commented on Jun 16, 2025

    @mkapal
    Member

    No, importing the packet classes is the only way to do use them right now.

    What other way would you suggest?

  2. DevCobe commented on Jun 17, 2025

    @DevCobe
    Author

    oh ok, thanks.
    If i come up with something will drop it here

  3. DevCobe commented on Jul 4, 2025

    @DevCobe
    Author

    i added this in the common js index.js .... not so sure about esm yet

    /** Packet Classes */
    var packets = require("./packets");
    Object.keys(packets).forEach(function (key) {
    Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
    return packets[key];
    }
    });
    });

  4. mkapal commented on Jul 4, 2025

    @mkapal
    Member

    Do I understand correctly that your goal is to be able to import the packets directly from node-insim?

    Like this:

    const { IS_BTC, IS_MST } = require('node-insim');

    The decision to import them from node-insim/packets was done intentionally, to separate the packet-related imports from the rest, but I'm open for opinions.

    Do you think it would be better to import everything from node-insim instead?

  5. DevCobe commented on Jul 11, 2025

    @DevCobe
    Author

    Do I understand correctly that your goal is to be able to import the packets directly from node-insim?

    Like this:

    const { IS_BTC, IS_MST } = require('node-insim');
    The decision to import them from node-insim/packets was done intentionally, to separate the packet-related imports from the rest, but I'm open for opinions.

    Do you think it would be better to import everything from node-insim instead?

    yes

  6. theangryangel commented on Jul 16, 2025

    @theangryangel

    Speaking as someone who isn't super involved in typescript and/or javascript, I'd be curious to know what the benefit is @DevCobe? This seems a bit like tidying up deck chairs on the Titanic.

  7. DevCobe commented on Jul 16, 2025

    @DevCobe
    Author

    Speaking as someone who isn't super involved in typescript and/or javascript, I'd be curious to know what the benefit is @DevCobe? This seems a bit like tidying up deck chairs on the Titanic.

    When i wanted to package it as a standalone app it gives errors as no package name exist with . /packets or can't find the module name with . /packets
    Benefits is alot... Simplifies getting classes

  8. mkapal commented on Jul 16, 2025

    @mkapal
    Member

    There may be something wrong with the configuration of your packager of choice. If you want, you can share some details of your workflow and maybe we can fix it together.

    In any case, splitting the node-insim imports into two paths like this was probaly unnecessary. I don't think there would be a naming conflict if everything was imported from the root namespace.

  9. DevCobe commented on Aug 4, 2025

    @DevCobe
    Author

    you can check my youtube page with what i build with it..https://www.youtube.com/@gracechildracing.
    I want to develop a full overlay.

  10. locked and limited conversation to collaborators on Aug 27, 2025
  11. converted this issue into a discussion #73 on Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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