npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

typed-wireshark-plugin

v0.1.10

Published

Build your WireShark plugins (dissectors, etc.) in TypeScript with powerful types!

Readme

typed-wireshark-plugin

Build your WireShark plugins (dissectors, etc.) in TypeScript with powerful types!

GitHub Workflow Status npm

Why you need this

Sometime you need to develop your own wireshark dissector to recognize and parse your data packet if wireshark not support that protocal. The offical way is using lua. It's really hard and unfriendly for those newbies because lua is a language without types supported. You need to read the references documents once and once again when you develop dissectors especially if you are new on it. Some obvious bug can't be found in development stage and you need reload the plugin in WireShark again and again to adjust it.

typed-wireshark-plugin provided full typing supported and can compile to lua base on TypeScriptToLua. You can found obvious bug in compile time and save your time.

Installation

typed-wireshark-plugin is a npm package with full typing supported for wireshark lua plugins and provide a cli tool to init your own project, just run:

mkdir foo-proto
cd foo-proto
npx typed-wireshark-plugin init

Then using yarn to install dependencies:

yarn

Then you can develop your own WireShark plugins now.

Usage

Screenshot

Edit the file index.ts, you may need some knowledge about how to develop WireShark plugins. See to get more detail.

Example code:

{
    const proto_hid = Proto("foo", "Foo Protocal");
    const field_packet_header = ProtoField.uint8("foo.packet_header", "Packet Header", base.HEX);

    proto_hid.fields = [
        field_packet_header
    ];

    const dissector_data = Dissector.get('data');

    function dissector_hid (this: void, buf: Tvb, pkt: Pinfo, tree: TreeItem): boolean {
        const value_packet_header = buf(0, 1);
        if (value_packet_header.uint() != 0x7e) {
            return false
        }

        const tree_buf = tree.add(proto_hid, buf);
        pkt.cols.protocol = "HID"

        tree_buf.add(field_packet_header, value_packet_header);
        return true
    }

    proto_hid.dissector = function (buf, info, tree) {
        if (!dissector_hid(buf, info, tree)) {
            dissector_data.call(buf, info, tree)
        }
    }

    const tcp_table = DissectorTable.get('tcp.port') as DissectorTable; 
    tcp_table.add(9999, proto_hid);
}

Then run

yarn build

You will find index.lua in the same directory if no error. Then you can import to your WireShark and use it!

--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
do
    local proto_hid = Proto("foo", "Foo Protocal")
    local field_packet_header = ProtoField.uint8("foo.packet_header", "Packet Header", base.HEX)
    proto_hid.fields = {field_packet_header}
    local dissector_data = Dissector.get("data")
    local function dissector_hid(buf, pkt, tree)
        local value_packet_header = buf(0, 1)
        if value_packet_header:uint() ~= 126 then
            return false
        end
        local tree_buf = tree:add(proto_hid, buf)
        pkt.cols.protocol = "HID"
        tree_buf:add(field_packet_header, value_packet_header)
        return true
    end
    proto_hid.dissector = function(buf, info, tree)
        if not dissector_hid(buf, info, tree) then
            dissector_data:call(buf, info, tree)
        end
    end
    local tcp_table = DissectorTable.get("tcp.port")
    tcp_table:add(9999, proto_hid)
end

Roadmap

  • [x] Basic typings
  • [ ] Descriptions for functions and params
  • [ ] More example
  • [ ] Testing

Contributing

This project is now in very early stage. Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Authors

@CuberL

Many thanks to TypeScriptToLua

License

MIT