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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cdsp-scpo/questionnaire-js-helpers

v1.0.0

Published

Helper JS functions for social survey questionnaires

Downloads

110

Readme

JS Helper Functions for Social Survey Questionnaires

Background

This repository provides utility javascript functions that can be used to customize social survey questionnaires like Qualtrics. These functions can be used along with any questionnaire as long as they support injecting custom JS into the survey flow.

Currently, the library provides custom functions for the following:

Autocompletion of French Professions

The library provides an autocompletion function based on vanilla HTML and CSS to provide a list of PCS professions defined by INSEE to the survey respondents based on their input value. This helps the respondents to find their professions from a list of more than 5000 pre-defined professions list.

Demo

See Demo

Getting Started

The library can be downloaded and included with a <script> tag in the HTML.

<script src="https://cdn.jsdelivr.net/npm/@cdsp-scpo/questionnaire-js-helpers/dist/questionnaire-helpers.bundled.js"></script>

If a specific version of the library is required:

<script src="https://cdn.jsdelivr.net/npm/@cdsp-scpo/questionnaire-js-helpers/dist/[email protected]"></script>

Using PCS Autocompletion

PCS autocompletion can be used with any regular HTML input field. If the ID of the target input element is pcs-professions, the helper function can be used as follows:

<script>
    questionnaireHelpers.autocompletePCSProfessions("pcs-professions");
</script>

The function autocompletePCSProfessions takes an optional argument to configure the autocompletion function. The optional argument has the following structure:

{
    strategy: "fuzzy",
    gender: "homme",
    css: {
        autocompleteItemsClass: "pcs-autocomplete-items",
        autocompleteActiveClass: "pcs-autocomplete-active",
    }
}

where each key can be explained as follows:

  • strategy: Matching strategy. Can take either fuzzy or native. Default is fuzzy and it uses microfuzz to search for matches. native strategy is more basic where exact matches of input string are checked.
  • gender: Gender for the professions. Default is homme.
  • css: This object contains the names of the CSS classes to be used in the autocompletion containers. autocompleteItemsClass is used for the container that shows the list of matches where as autocompleteActiveClass is used for the container that highlights the current selection in rhe list. Default CSS classes can be found in the pcs.css file.

For instance, if professions for female with native search strategy is needed:

<script>
    questionnaireHelpers.autocompletePCSProfessions("pcs-professions", { strategy: "native", gender: "femme" });
</script>

License

This project is licensed under Apache 2.0 - see the LICENSE file for details.

Authors

This work has been created by the developers of CDSP at SciencesPo.