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

fo-sticky-note

v1.0.3

Published

**fo-sticky-note** is a **Vue.js** component that provides a full-featured sticky note control.

Downloads

10

Readme

fo-sticky-note Component for Vue.js

fo-sticky-note is a Vue.js component that provides a full-featured sticky note control.

fo-sticky-note is written in ECMAScript 6th Edition (a.k.a. ECMAScript 2015, a.k.a. ES6) and is intended for inclusion in an ES6 application. No provision has been made for supporting earlier JavaScript editions.

fo-sticky-note is provided as an ES6 module. No provision has been made for older idiosyncratic module formats such as CommonJS or AMD.

fo-sticky-note is packaged into a single file using rollup.js. Currently the bundle is not minified or uglified; we intend to do this in a later release.

Using fo-sticky-note

To include fo-sticky-note in your project, simply import it using the ES6 import statement:

import FoStickyNote from 'fo-sticky-note-bundle.js'

Then include it as a component in your Vue.js model:

var vueModel = new Vue({
    el: '#app',
    components: {
        FoStickyNote
    }
})

This will make the <fo-sticky-note> tag available for use within your project's HTML.

Attributes

The following attributes can be included in an <fo-sticky-note> tag:

  • id   Required; every <fo-sticky-note> instance must have a unique id value
  • note   The initial contents of the note
  • noteTitle   The note's title; this text appears in the shaded bar at the top of the note

Values for the following attributes are expressed using CSS syntax:

  • background-color   The note's background color
  • font-family   The typeface to use
  • font-size   How big you want the type to be
  • line-height   The amount of spacing between lines of text
  • menu-is-pinned   Use to keep the menu and the color button in selected mode while a color picker is displayed

Events

  • blur   Emitted when the sticky note loses focus
  • close-button-click   Emitted when the close button is clicked
  • color-button-click   Emitted when the color button is clicked
  • color-button-unclick   Emitted when the color button is clicked while the menu is pinned
  • menu-on-mouse-leave   Emitted when the mouse pointer leaves the region of the menu
  • note-change   Emitted when the note text changes
  • title-change   Emitted when the title text changes

Example

<fo-sticky-note 
    id="note1"                    
    note="Remember to do what I forgot to do."
    background-color="LemonChiffon"
    v-on:note-change="noteOnChange()">
</fo-sticky-note>

Building fo-sticky-note

The source code for fo-sticky-note can be found in the src directory. The build process uses the file fo-sticky-note.js plus files from the src/lib directory and the src/node_modules directory.

When you clone or download the git repo, you don't get the src/node_modules directory. Since this directory can be easily re-generated using npm, there's no reason to include it in the git repo. The src/package.json contains all of the information needed to re-generate the src/node_modules directory. To do this, cd to the src directory and enter the command:

npm install

npm will fetch and install all of the node modules listed in package.json.

fo-sticky-note is built into a rollup.js bundle using the build.sh script found in the src directory. At this writing, build.sh contains only the command rollup -c. We have the habit of creating a build.sh script no matter how simple its contents so that we never have to remember which command(s) to use for different kinds of projects.

To build the bundle, cd to the src directory and enter the command

./build.sh

After a successful build, you should see the following results:

fo-sticky-note.js → ../dist/fo-sticky-note-bundle.js...
created ../dist/fo-sticky-note-bundle.js in 1.8s

Running the Test Application

The included test application can be run from the test directory.

As you did with the src directory, you must run npm install to re-generate the node_modules directory used by the test application.

The test application can be run using the http-server npm module. To run it, cd to the test directory and enter the command

http-server

This will open a simple web server that serves its content on http://localhost:8080.

Dependencies

fo-sticky-note's dependencies fall into two categories, those that are bundled into fo-sticky-note-bundle-js and those that are expected to be present in the project in which fo-sticky-note is used.

The latter category includes widely-used libraries such as JQuery, Lodash, and Vue.js.

Bundled into fo-sticky-note-bundle-js are libraries that are unique or specific to fo-sticky-note.

You can change which libraries you want to bundle or keep external by editing the src/package.json file and moving them between the dependencies and devDependencies sections, or through use of the external option in src/rollup.config.js. You need to re-build the bundle after making any such changes.

Getting fo-sticky-note from NPM

If you want to use the dist/fo-sticky-note-bundle.js in your project and don't think you'll ever need to re-build it, you can obtain it from NPM using the command

npm install fo-sticky-note

This will place a copy of fo-sticky-note-bundle.js in your project's node_modules directory along with its dependencies. You can then import it into your ES6 JavaScript using the command

import FoMarkdownNote from 'node_modules/fo-sticky-note/fo-sticky-note-bundle.js'

In this scenario, fo-sticky-note-bundle.js will contain all of the bundled dependencies, and the external dependencies will be made known to NPM in the npm/package.json file. This package.json file is different from the one found in the src directory, and is used only for publishing on NPM.

Acknowledgements

Like most open source projects, fo-sticky-note is based on the work of others.

We also gratefully acknowledge the JQuery and Lodash projects on which so much the web is built.