You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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');
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?
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?
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.
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
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.
Activity
mkapal commentedon Jun 16, 2025
No, importing the packet classes is the only way to do use them right now.
What other way would you suggest?
DevCobe commentedon Jun 17, 2025
oh ok, thanks.
If i come up with something will drop it here
DevCobe commentedon Jul 4, 2025
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];
}
});
});
mkapal commentedon Jul 4, 2025
Do I understand correctly that your goal is to be able to import the packets directly from
node-insim?Like this:
The decision to import them from
node-insim/packetswas 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-insiminstead?DevCobe commentedon Jul 11, 2025
yes
theangryangel commentedon Jul 16, 2025
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.
DevCobe commentedon Jul 16, 2025
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
mkapal commentedon Jul 16, 2025
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.
DevCobe commentedon Aug 4, 2025
you can check my youtube page with what i build with it..https://www.youtube.com/@gracechildracing.
I want to develop a full overlay.