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

web-window-manager

v1.0.21

Published

A window manager for maintaining window parent child relationships

Downloads

5

Readme

TODO

  • [x] Add appropriate readme boilerplate
  • [x] Add complete readme details
  • [x] Add examples
  • [ ] abstract cache manager to new npm package

Web-Window-Manager

A Window Manger for managing the creation and deletion of windows/tabs within a web based application.

Badges

npm version License: MIT Release

Table Of Contents

About The Project

This package allows developers to build applications that can open windows/tabs at an infinite depth (theoretically) and close all windows/tabs, based on some "event", that are "children" of the window/tab that triggered the event. This solves the problem some web applications have with persistence and ensuring all children are closed given various edge cases.

  • EVENT: a button click, hot key, or anything else (fully customizable)
  • CHILDREN: a window/tab that was opened by a given window/tab

Built With

Getting Started

To get started with the Web-Window-Manager, you will need to have the following prerequisites installed:

  • Node.js
  • npm (comes with Node.js)

Once you have these prerequisites installed, you can proceed to install the Web-Window-Manager package using npm:

npm i web-window-manager

After installing the package, you can import and use it in your project as shown in the Usage section above.

Usage

Import the Web-Window-Manager file into your entry file (e.g. app.tsx in a React project):

import 'web-window-manager'

Replace any window.open() calls in your code with window.windowManager.open():

// Before
window.open('https://www.example.com', '_blank')

// After
window.WindowManager.openWindow({ link: '/some-link', name: `some-name` })

This will use the Web-Window-Manager to open the new window/tab, allowing you to track and manage it within your application.

Add a simple React button with an onClick prop that calls window.windowManager.recursivelyCloseChildren() with a label of "Logout":

import 'web-window-manager'

function App() {
  return (
    // NOTE: you must call it from an arrow function in this context because
    // this function expects a number parameter or undefined
    <button onClick={() => window.windowManager.recursivelyCloseChildren()}>
      Logout
    </button>
  )
}

When the user clicks the "Logout" button, this will close all child windows/tabs that were opened by the current window/tab.

For more detailed usage instructions and examples, please see the Web-Window-Manager documentation examples.

See the open issues for a full list of proposed features (and known issues).

Roadmap

  • The Web-Window-Manager package is still in development, and the following features are planned for future releases:

    • Abstract the cache manager to a separate npm package
    • Add more detailed examples
    • usage instructions in the readme
    • make window details customizable

Contributing

If you would like to contribute to the development of the Web-Window-Manager package, please follow these steps:

  1. Fork the repository
  2. Create a new branch for your changes (e.g. feature/new-feature)
  3. Make your changes and commit them to your branch
  4. Push your branch to your forked repository
  5. Open a new pull request from your branch to the master branch of the original repository

Distributed under the MIT License. See LICENSE.txt for more information.

Me - @Triston08227721 - [email protected]

Project Link: https://github.com/Tarmstrong95/WebWindowManager

Acknowledgments

  • Shields.io for providing the badges used in the readme.
  • Lodash for providing the utility functions used in the package.