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

xwiki-tools

v0.7.1

Published

Tools for building documents and packages suitable for import into XWiki.

Downloads

8

Readme

XWiki Tools

XWiki labs logo

Toolchain for building and dumping XWiki Archive (xar) files.

Intallation

With nodejs and npm installed, use:

sudo npm install -g xwiki-tools

Workflow

Dump a page from a running wiki to a directory structure

xardump <user>:<password>@<wiki hostname>:<wiki port>/<wiki export path>
Example: xardump Admin:admin@blk1:8080/xwiki/wiki/xwiki/export/Main/WebHome

Build an XWiki Archive from directory structure

xargen

Build an XWiki Archive and auto-import it into a running XWiki instance

xargen --post <user>:<password>@<wiki hostname>:<wiki port>/<wiki rest import path>
Example: xargen --post Admin:admin@blk1:8080/xwiki/rest/wikis/xwiki

Workflow Example

Dump xar from running subwiki (named wiki1):

user@toshitba:~/Desktop/test$ rm ./* -rf
user@toshitba:~/Desktop/test$ xardump Admin:admin@blk1:8080/xwiki/wiki/wiki1/export/Main/WebHome
query: Admin:admin@blk1:8080//xwiki/wiki/wiki1/export/Main/WebHome?name=x&pages=Main.WebHome
STATUS: 200
HEADERS: {"server":"Apache-Coyote/1.1","set-cookie":["JSESSIONID=B630723680EB9BA8CEF6CACD9E41E196; Path=/xwiki/; HttpOnly"],"content-disposition":"attachment; filename=x.xar","content-type":"application/zip;charset=ISO-8859-1","content-language":"en","transfer-encoding":"chunked","date":"Tue, 31 Mar 2015 14:16:59 GMT"}
writeDir: /home/user/Desktop/test/src
writeDir: /home/user/Desktop/test/src/xwiki
writeDir: /home/user/Desktop/test/src/xwiki/Main
writeDir: /home/user/Desktop/test/src/xwiki/Main/WebHome
writeDir: /home/user/Desktop/test/src/xwiki/Main/WebHome/objects
writeDir: /home/user/Desktop/test/src/xwiki/Main/WebHome/objects/XWiki.EditModeClass_1
writeFile: /home/user/Desktop/test/src/xwiki/Main/WebHome/objects/XWiki.EditModeClass_1/this.js
writeDir: /home/user/Desktop/test/src/xwiki/Main/WebHome/attachments
writeFile: /home/user/Desktop/test/src/xwiki/Main/WebHome/attachments/xwiki-logo.png
writeFile: /home/user/Desktop/test/src/xwiki/Main/WebHome/this.js
writeFile: /home/user/Desktop/test/src/xwiki/Main/WebHome/content.xwiki20
writeDir: /home/user/Desktop/test/src/classes
writeFile: /home/user/Desktop/test/src/classes/XWiki.EditModeClass.js
done
user@toshitba:~/Desktop/test$ 

Edit content:

user@toshitba:~/Desktop/test$ echo 'HAI MOM' >> ./src/xwiki/Main/WebHome/content.xwiki20

Re-Package:

user@toshitba:~/Desktop/test$ xargen
ran ./src//classes//XWiki.EditModeClass.js
ran ./src/xwiki/this.js
ran ./src//xwiki/Main/WebHome/this.js
attachment ./src//xwiki/Main/WebHome/attachments/xwiki-logo.png
obj ./src//xwiki/Main/WebHome/objects/XWiki.EditModeClass_1
ran ./src//xwiki/Main/WebHome/objects/XWiki.EditModeClass_1/this.js
/tmp/xwiki-tools-genxar115231-14509-1j2gifu/package.xml Generating
package.xml Compressing
package.xml Complete
/tmp/xwiki-tools-genxar115231-14509-1j2gifu/Main/WebHome.xml Generating
Main/WebHome.xml Compressing
Main/WebHome.xml Complete
user@toshitba:~/Desktop/test$ ls
i-forgot-to-edit-src-slash-xwiki-slash-this-dot-js.xar  src
user@toshitba:~/Desktop/test$ 

Package and auto-post to subwiki (called wiki1):

user@toshitba:~/Desktop/test$ xargen --post Admin:admin@blk1:8080/xwiki/rest/wikis/wiki1
ran ./src//classes//XWiki.EditModeClass.js
ran ./src/xwiki/this.js
ran ./src//xwiki/Main/WebHome/this.js
attachment ./src//xwiki/Main/WebHome/attachments/xwiki-logo.png
obj ./src//xwiki/Main/WebHome/objects/XWiki.EditModeClass_1
ran ./src//xwiki/Main/WebHome/objects/XWiki.EditModeClass_1/this.js
/tmp/xwiki-tools-genxar115231-15382-1xl6muj/package.xml Generating
package.xml Compressing
package.xml Complete
/tmp/xwiki-tools-genxar115231-15382-1xl6muj/Main/WebHome.xml Generating
Main/WebHome.xml Compressing
Main/WebHome.xml Complete
Posting to [blk1]:8080/xwiki/rest/wikis/wiki1?backup=true&history=RESET
STATUS: 200
HEADERS: {"set-cookie":["JSESSIONID=444CF64309319D262CCC7E8090F0DF52; Path=/xwiki/; HttpOnly"],"date":"Tue, 31 Mar 2015 14:21:00 GMT","accept-ranges":"bytes","server":"Restlet-Framework/2.0.14","xwiki-user":"XWiki.XWikiGuest","xwiki-version":"6.0-SNAPSHOT","content-type":"application/xml;charset=UTF-8","content-language":"en","transfer-encoding":"chunked"}
BODY: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><wiki xmlns="http://www.xwiki.org"><link href="http://blk1:8080/xwiki/rest/wikis/wiki1/spaces" rel="http://www.xwiki.org/rel/spaces"/><link href="http://blk1:8080/xwiki/rest/wikis/wiki1/classes" rel="http://www.xwiki.org/rel/classes"/><link href="http://blk1:8080/xwiki/rest/wikis/wiki1/modifications" rel="http://www.xwiki.org/rel/modifications"/><link href="http://blk1:8080/xwiki/rest/wikis/wiki1/search" rel="http://www.xwiki.org/rel/search"/><link href="http://blk1:8080/xwiki/rest/wikis/wiki1/query" rel="http://www.xwiki.org/rel/query"/><id>wiki1</id><name>wiki1</name></wiki>
user@toshitba:~/Desktop/test$