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 🙏

© 2024 – Pkg Stats / Ryan Hefner

find-msgid-in-file

v0.1.0

Published

Finds the MSGID of a Fidonet message in the file containing that message.

Downloads

3

Readme

(a histogram of downloads)

This module (find-msgid-in-file) finds the MSGID of a Fidonet message in the file containing that message.

Such a file (containing a Fidonet message) is typically generated by a Fidonet message editor when it calls an external utility. (For example, GoldED+ or GoldED-NSF would generate such a file if the corresponding GoldED's ExternUtil configuration line contains the @file parameter.)

This module is written in JavaScript and requires Node.js to run. It uses some ECMAScript 2015 features, and thus a relatively recent Node.js is required. This module is tested against the latest stable version of Node.js.

Installing the MSGID finder

(npm package version)

  • Latest packaged version: npm install find-msgid-in-file

  • Latest githubbed version: npm install https://github.com/Mithgol/node-find-msgid-in-file/tarball/master

You may visit https://github.com/Mithgol/node-find-msgid-in-file#readme occasionally to read the latest README because the package's version is not planned to grow after changes when they happen in README only. (And npm publish --force is forbidden nowadays.)

Using the MSGID finder

When you require the installed module, you get a function that finds the MSGID of a Fidonet message (in the file containing that message) asynchronously.

That function has two parameters. The first parameter must be the path to the file containing a Fidonet message. The second parameter is a callback function with a signature (error, MSGID) that asynchronously receives the MSGID. One of the following happens:

  • callback(someError) is called if an error occurs in fs.readFile of the given file

  • callback(null, null) is called if the file does not seem to contain a MSGID kludge

  • callback(null, MSGID) is called if the MSGID is found

The MSGID kludge in the given file is expected to adhere to the FTS-0009 standard: the kludge appears on a separate line of the file, starts with '\x01MSGID:', then one or several optional whitespaces, then the MSGID value, then the end of that line. Only that MSGID value (as a JavaScript string) is passed to the callback (i.e. the standard beginning of that line is removed from the string before the call).

Testing the MSGID finder

(build testing status)

It is necessary to install JSHint for testing.

  • You may install JSHint globally (npm install jshint -g) or locally (npm install jshint in the directory of the MSGID finder).

After that you may run npm test (in the directory of the MSGID finder). Only the JS code errors are caught; the code's behaviour is not tested.

License

MIT license (see the LICENSE file).