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

fiunis

v3.0.0

Published

A decoder and an encoder of Fidonet Unicode substrings.

Downloads

28

Readme

This module is a decoder and an encoder of Fidonet Unicode substrings.

It is called Fiunis after a hangman's pun “finis coronat opus” → “funis coronat opus” that appeared in Walter Scott's “Quentin Durward” in 1823. (The word “string” sometimes also has the meaning “rope” or “cord”, equivalent to the Latin “funis”.)

This repository does also contain draft standards of Fidonet Unicode substrings for the Fidonet Global Hypertext Interface project.

  • The fiunis.txt file is the English version of the draft.

  • The fiunis.rus.txt file is the Russian version of the draft. This version is provided in UTF-8 (for the diffs to look reasonably good on GitHub and other git tools) and thus should be converted to CP866 encoding (common in Russian Fidonet) before posting to Fidonet.

This module is a reference implementation of these standards.

Fiunis is written in JavaScript and requires Node.js to run.

  • Starting from v3.0.0, Fiunis requires Node.js version 4.0.0 or newer because it is rewritten in ECMAScript 2015 (ES6).

  • You may run older versions of Fiunis (that precede v3.0.0) with older Node.js versions (0.10.x or 0.12.x). Those older versions of Node.js are themselves not maintained by their developers after 2016-12-31.

Installing Fiunis

(npm package version) (a histogram of downloads)

  • Latest packaged version: npm install fiunis

  • Latest githubbed version: npm install https://github.com/Mithgol/fiunis/tarball/master

The npm package does not contain the tests, they're published on GitHub only.

You may visit https://github.com/Mithgol/fiunis#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 Fiunis

When you require() the installed module, you get an object that has the following methods:

decode(text)

Replaces all occurrences of Fidonet Unicode substrings in the given text by their decoded Unicode equivalents.

For example, .decode('The video “&+mAJcFlwNbHpOS3p/iTJbUHvH-;” is interesting.') returns 'The video “頂尖對決之穿褲子篇” is interesting.'.

encode(text, [encoding])

This method converts the given text to Fidonet Unicode substrings (either as a whole or partially). This method has the two different possible behaviours:

  • If encoding is undefined, this method returns a JavaScript string with the Fidonet Unicode substring equivalent of the whole given text.

    • For example, .encode('頂尖對決之穿褲子篇') returns '&+mAJcFlwNbHpOS3p/iTJbUHvH-;'.
    • The whole given text is converted (even its ASCII characters). You should either detect (beforehand) which substrings should be given to this encoder (and what other substrings would be left to a traditional 8-bit encoding) or use some other encoder that decides that automatically. (This method can also decide that, but only if some encoding is given, see below.)
  • If encoding is not undefined, this method returns a Node.js Buffer with the given text converted to the given encoding.

    • And if some fragments of the given text consist of characters that cannot be represented in the given encoding, then Fidonet Unicode substrings are used to encode such fragments.
    • The given encoding must be an encoding understood by the iconv-lite module (otherwise an error is thrown).
    • The given encoding should also be a single-byte encoding (that generates exactly one byte for each of the characters it can represent). Otherwise the behaviour of this method is not reliable. (An error is also thrown, but only if a multi-byte encoding can be detected for certain, i.e. if the resulting Buffer's length is not equal to the text's length even before Fidonet Unicode substrings are created.)

Testing Fiunis

(build testing status)

The tests are not included in the npm package of the module (to keep it small). Use the version from GitHub.

It is necessary to install Mocha and JSHint for testing.

  • You may install Mocha globally (npm install mocha -g) or locally (npm install mocha in the directory of Fiunis).

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

After that you may run npm test (in the directory of Fiunis).

Notable breaking changes

A stronger escaping method is applied in version 2.0 (see #1). Fidonet Unicode substrings are now ended by -; instead of former ;.

License

Distribution of the standards of Fidonet Unicode substrings is unlimited (see section 1), provided that the text is not altered without notice.

The rest of the repository is MIT-licensed (see the LICENSE file).