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

quick-survey-js

v0.1.7

Published

<div align="center"> <img width="600px" alt="Vue.js" src="./logo.png"/> </div>

Downloads

1

Readme

Quick-Survey-JS is a quick and simple JavaScript Survey Module.

Quick-Survey-JS offers a quick way to add a simple survey to your website. It is a set of Vue JS components of creating, completing, and viewing survey questions and results.

License: MIT

Getting Started

Intsall the client side package using npm.

npm install quick-survey-js

1. Set up your api in config.js

Set up USER_SURVEY_API and ADMIN_SURVEY_API (these names shouldn't change) in your config.js that each component would use as required to run the app. If you need to set up an API server, please visit our git repository here.

Example

//config.js
export const USER_SURVEY_API = `${VUE_APP_API_ENDPOINTS}/survey`;
export const ADMIN_SURVEY_API = `${VUE_APP_API_ENDPOINTS}/admin/survey`;

1. Import components in your Vue project

There are 3 components that you may import as needed - to create a survey, submit answers to a survey, and view survey results. You may import the components on your existing or new application as guided below.

// main.js
import { quickSurveyJS } from 'quick-survey-js';
import 'quick-survey-js/dis/quick-survey-js.css';

Vue.use(quickSurveyJS);

1. Use components

Example

<template>
  <SurveyAdmin @survey-created="onCreated" @failed-to-create-survey="onFailed" />
</template>

3. Set required props and methods

To get the components working, there are required props to pass each. The events emitted from each component call the methods where you can specify in your parent component what actions to be taken. Please refer to below for required props and methods.

Create Survey

<SurveyAdmin
    :userKey="yourUserKey"
    @survey-created="yourMethod"
    @failed-to-create-survey="yourMethod"
  />

userKey: used to distinguish general survey respondents, survey creators, and respondents who have already submitted answers. survey-created: Once the survey is created and the submit button is clicked on the browser, this event is emitted. failed-to-create-survey: this event is emitted once it fails to create a survey.

Submit Survey

<Survey
    :surveyId="yourSurveyID"
    :userKey="yourUserKey"
    @sent-vote="yourMethod"
    @voted-already="yourMethod"
    @closed-survey="yourMethod"
    @failed-to-close-survey="yourMethod"
  />

surveyID: Once a survey is created, the surveyId is created - then it can be passed as prop to Survey component which the survey page that general users can view and participate. sent-vote: the event emitted once the user submits an answer. voted-already: the event emitted once it has been confirmed that the user has already voted before. closed-survey: the event emitted once the survey creator chooses to close the survey immediately. failed-to-close-survey: the event emitted once it fails to close the survey.

View Survey Results

<SurveyResults
    :surveyId="yourSurveyID"
    :userKey="yourUserKey"
  />