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

tussenvoegsels

v1.0.0

Published

A library to help you with family name prepositions in Dutch last names.

Downloads

17

Readme

tussenvoegsels

A library to help you with family name prepositions in Dutch last names.

"A tussenvoegsel (lit. 'between-joiner') in a Dutch name is a family name affix positioned between a person's given name and the main part of their family name. There are similar concepts in many languages, such as Celtic family name prefixes, French particles, and the German von." - Wikipedia

Why this library?

A lot of Dutch websites have forms that only take a last name, including the preposition. In some cases, it may be desirable to filter it out, for example when sorting a list of names, otherwise you'd have a massive clump of names for every common preposition. This library allows you to separate it from a last name, to allow you to process it however you want.

Usage

import {findPreposition} from 'tussenvoegsels';

findPreposition('van Oranje'); // {preposition: 'van ', lastName: 'Oranje'}

// Note: By default we include the trailing space since some prepositions don't have one.
// If you don't want it, you can use the stripTrailingSpace option to disable it.
findPreposition('van Oranje', {stripTrailingSpace: true}); // {preposition: 'van', lastName: 'Oranje'}

Options

An optional options object can be passed to the second argument. The list below shows their purpose and default values

{
    prepositions = DutchPrepositions, // The array of prepositions to use. Uses the default bundled list if not specified. 
                                      // When supplying your own list, make sure your prepositions end with a space when there
                                      // is a space between the preposition and the last name, otherwise the trailing space
                                      // would get included in the last name.

    exclude = [], // An array of prepositions to exclude from the list. Useful if you want to exclude a specific preposition
                  // from the default list. Keep in mind you'll need to end most prepositions with a trailing space.

    ignoreIfNoSuffix = true, // Ignores a preposition if no other characters remain after matching it.

    stripTrailingSpace = false // Strips the trailing space from the preposition.
}

Reporting issues and feedback

If you encounter any issues or have feedback, please open an issue on the GitHub issue tracker.