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

sf-login

v0.4.36

Published

login page for sf wewbsites

Readme

sf-login

Get the login app and deploy it

yarn add sf-login
yarn add [email protected] [email protected] @vue/[email protected] @vue/[email protected]

build the app :

yarn build-login path/to/myfolder clean

path/to/myfolder : from root directory clean : if defined, will clear target folder before building

set template file :

<body>
<div id="app"></div>
<script src="path/to/my/folder?"></script>
<script>
    window.onload = function () {
      var sfLogin = new LoginApp('path/to/my/folder').initApp()
    }
</script>
</body>

customize app

Configure sf-login.config.js

There are two exports in the sf-login.config.js (automatically created in the root directory if missing) file, the default defines theme options and the "createAccount" defines input options for the account creation form.

Theme export

export default {
  name: 'webpage title',
  logo: 'path/to/logo',
  background: 'path/to/background',
  scheme: 'dark',
  colors: {
    accent: 'white',
    primary: '#fffff',
    highlight: 'rgb(255,255,255)',
    'accent-light': 'rgba(255,255,255,0.5)',
    'primary-light': 'linear-gradient(from left, #fff, #000)',
    'primary-lighter': 'linear-gradient(from left, #fff, #000)'
  },
  supportedLanguages: ['fr', 'en'],
  accountCreation: true,
  paths: {
    preauth: 'path/to/preauth',
    auth: 'path/to/auth',
    forgetpass: 'path/to/forgetpass',
    create: 'path/to/create',
    redirect: 'redirect/after/auth'
  }
}
name :

STRING (optional) forces document title if defined

logo :

STRING (required) path to logo

background :

STRING (required) path to background image

scheme :

STRING (optional) if set to dark, theme will use white text, else black text will be used

colors :

STRING (optional) define the 6 colors of the app (if undefined, default colors will be used)

supportedLanguages :

STRING (required) defines options to be displayed in language picker (note that they should match translations object property names)

accountCreation :

BOOLEAN (required) is account creation enabled for this theme

paths :

OBJECT (required) contains routes for each api call

path[routeName] :

STRING (required) define which url is used for api calls (preauth, auth, forgetpass, create) and redirection after auth

Create account export

export const createAccount = {
  data () {
    return {
      inputsToValidate: ['myInput'],
      inputs: {
        createAccount: {
          myInput: {
            value: '',
            state: null,
            type: 'text',
            classes: 'css-class other-css-class',
            validate: 'inputValidationFunction',
            comparator: 'myOtherInput'
          },
          myOtherInput: {
              value: 'defaultValue',
              state: 'valid',
              type: 'email',
              classes: 'css-class other-css-class',
              validate: 'otherInputValidationFunction'
            }
        }
      },
      texts: {
        en: {
          myInput: 'myInputPlaceholder'
        },
        fr: {
          myInput: 'placeholderDeMonChampsDeTexte'
        }
      }
    }
  }
}
inputs.createAccount :

OBJECT (optional) object containing all inputs that will be rendered in the account creation form

inputs.createAccount.myInput :

OBJECT (optional) object containing parameters of the input that will be rendered in the account creation form

inputs.createAccount.myInput.value :

STRING (required) input default value (leave as '' if you want it empty)

inputs.createAccount.myInput.state :

STRING (required) can be null, 'valid' or 'wrong'. if 'validate' property is defined, state property will be updated on keyup and 'valid' state will be required in order to validate form

inputs.createAccount.myInput.type :

STRING (required) HTML5 input type (eg: 'text')

inputs.createAccount.myInput.classes :

STRING (optional) a string containing all supplementary css classes, separated by spaces

inputs.createAccount.myInput.validate :

STRING (optional) name of the function to be used for validation WARNING: validation functions are defined in src/js/fieldValidation.js, you can write new functions in this file under new export names, but don't forget to import them in src/vue/CreateAccount.vue input value is passed as parameter in validation functions

inputs.createAccount.myInput.comparator :

STRING (optional) name of another input which value will be passed to your validation function as a second parameter

inputsToValidate :

ARRAY of STRING (optional) a list of inputs that should be "valid" in order to send a form, input objects should have a "validation" property

texts :

OBJECT (optional) list of languages, should correspond "supportedLanguages" naming

texts.myLanguage :

OBJECT (optional) list of strings that'll be translated depending on selected language, property name should correspond input name, string will be used as matching input placeholder

Modify the login app

Clone this repository, then install dependencies :

yarn

Compiles and hot-reloads for development :

yarn serve

Run your tests :

yarn test

To properly update this project for production :

  • 1 - commit and push project
  • 2 - publish new version of package :
yarn publish