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

cwrc-git-dialogs

v4.0.0

Published

Dialogs for listing, loading, and saving CWRC XML documents.

Downloads

5

Readme

cwrc-git-dialogs

Picture

Travis Codecov version downloads GPL-2.0 semantic-release Commitizen friendly experimental

  1. Overview
  2. Demo
  3. Installation
  4. API
  5. Use
  6. Development

Overview

A suite of dialogs for loading, saving, and listing files. Meant to be used in conjunction with CWRC-GitWriter. Relies upon an instance of CWRC-GitServer to make calls to GitHub.

Demo

The CWRC-GitWriter Sandbox is running an instance of CWRC-GitWriter, which uses the NPM package published from this repository along with the code in CWRC-WriterBase. There is a corresponding server component running CWRC-GitServer and CWRC-Git. The same code is easily (for someone with modest development experience) installed on any server to run your own instance. If you are looking to put together your own CWRC-Writer, CWRC-GitWriter is a good place to start.

Installation

npm install cwrc-git-dialogs

API

Methods used by CWRC-WriterBase

save(CWRC-WriterBase writer)

Spawns a popup prompting the user to save or pull request the current document to a GitHub repository.

load(CWRC-WriterBase writer)

Spawns a popup prompting the user to load a document from a GitHub repository.

getDocumentURI()

Returns a string representing the URI of the current document.

getUserInfo()

Returns an object with the following properties: userId, userName, userUrl.

logOut()

Removes the GitHub OAuth token and reloads the page.

Additional configuration methods

setServerURL(String url)

Sets the URL for the location of the CWRC-GitServer instance.

useGitLab(Boolean useIt)

Whether to use GitLab API formatted calls. Defaults to false.

Use

When setting up CWRC-Writer, you register this module with a CWRC-WriterBase instance by passing it as a property on the config object used when instantiating the instance. After registering the module, CWRC-WriterBase will call this module's methods as required.

A simplified example:

import GitStorageDialogs from "cwrc-git-dialogs";
const config = {
  storageDialogs: GitStorageDialogs
};
const CWRCWriter = require("cwrc-writer-base");
const writer = new CWRCWriter(config);

See https://github.com/cwrc/CWRC-GitWriter/blob/master/src/js/app.js for the full example.

Development

CWRC-Writer-Dev-Docs explains how to work with CWRC-Writer GitHub repositories, including this one.