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

pw-components-js-dev-555

v0.0.9

Published

PW Components

Readme

pw-components-js-dev

Installation

Pour installer pw-components Package, exécutez simplement l'une ces commandes suivantes dans votre terminal :

  • Avec yarn:
yarn add pw-components-js-dev
  • Avec npm:
npm install pw-components-js-dev

Utilisation

Exemple d'utilisation

Pour utiliser pw-components Package dans votre projet, importez-le en utilisant la syntaxe suivante :

  • Description.js
import {
	Field,
	VALIDATION,
	RESTRICTION,
	LIMITATION
} from "pw-validation";

import { getField } from "common/functions/getField.js";

function getValidation() {
	return Field.getValidation()
}
function getRestriction() {
	return Field.getRestriction()
}
function getLimitation() {
	return Field.getLimitation()
}
function create(KEY) {
	var FIELD = getField();
    return Field.create({
        STRUCTURE:FIELD[KEY],
        VALIDATION:VALIDATION[KEY].INSCRIPTION,
        RESTRICTION:RESTRICTION[KEY],
        LIMITATION:LIMITATION[KEY],
    });
}
export {
	create
}
  • Dans le main.js
import {
    create
} from "common/structure/Description/Description.js";

function main() {
    getConfig().component = {}

    var email = create("EMAIL");
    var lastname = create("LASTNAME");
    var password = create("PASSWORD");
    var firstname = create("FIRSTNAME");
    var confirmPassword = create("CONFIRM_PASSWORD");

    getConfig().component.email = email
    getConfig().component.lastname = lastname
    getConfig().component.password = password
    getConfig().component.firstname = firstname
    getConfig().component.confirmPassword = confirmPassword

    setChildView(
        "#app_body_wrapper", 
        Composant, 
        getConfig().component
    );
    email.instance = getConfig().component.instance
    lastname.instance = getConfig().component.instance
    password.instance = getConfig().component.instance
    firstname.instance = getConfig().component.instance
    confirmPassword.instance = getConfig().component.instance
}
  • Dans le getField.js
import FIELDMG from "common/structure/FIELD/FIELD.mg.js"
import FIELDFR from "common/structure/FIELD/FIELD.fr.js"
import {Field} from "pw-validation";

function getField(){
	Field.addLang("FR", FIELDFR)
	Field.addLang("MG", FIELDMG)

	var FIELD = Field.getLang(window.lang)
	Object.keys(FIELD).map((field) => {
		Field.add(field, FIELD[field])
	})

	return Field.get();
}

export { getField }
  • Exemple pour FIELDFR
class FIELD {
	static LASTNAME = {
		NAME:"lastname",
		TYPE:"text",
		REQUIRED:true,
		PLACEHOLDER:{
			DEFAULT:"Votre nom de famille"
		},
		LABEL:{
			DEFAULT:"Entrez votre nom de famille"
		},
		MINIMUM_ERROR_MESSAGE:{
			DEFAULT:"Votre nom de famille doit contenir au moins 3 caractères"
		},
		MAXIMUM_ERROR_MESSAGE:{
			DEFAULT:"Votre nom de famille doit contenir au plus 255 caractères"
		},
		MUST_NOT_CONTAIN_NUMBER:{
			DEFAULT:"Votre nom de famille ne doit pas contenir de chiffre"
		},
		EMPTY_MESSAGE:{
			DEFAULT:"Veuillez saisir votre nom de famille"
		},
	}
	static FIRSTNAME = {
		NAME:"firstname",
		TYPE:"text",
		REQUIRED:true,
		PLACEHOLDER:{
			DEFAULT:"Votre prénom"
		},
		LABEL:{
			DEFAULT:"Entrez votre prénom"
		},
		MINIMUM_ERROR_MESSAGE:{
			DEFAULT:"Votre prénom doit contenir au moins 3 caractères"
		},
		MAXIMUM_ERROR_MESSAGE:{
			DEFAULT:"Votre prénom doit contenir au plus 255 caractères"
		},
		MUST_NOT_CONTAIN_NUMBER:{
			DEFAULT:"Votre prénom ne doit pas contenir de chiffre"
		},
		EMPTY_MESSAGE:{
			DEFAULT:"Veuillez saisir votre prénom"
		},
	}
}