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

@lightmill/convert-touchstone

v3.0.0-alpha.8

Published

Converts touchstone XML exports to lightmill format.

Downloads

10

Readme

@lightmill/convert-touchstone

Convert a touchstone XML design file as produce by touchstone's design platform to a format that can be directly provided to @lightmill/static-design.

Install

NPM

npm install @lightmill/convert-touchstone

Note: You might not need to install @lightmill/convert-touchstone, npx can be used to download and immediately run the program.

Direct download

Download the latest version then, then in your html file:

<script src="lightmill-convert-touchstone.js"></script>

The library will be injected in lightmill.convertTouchstone.

Usage

lightmill-convert-touchstone <input-file>

Or (if you do not need to install it and prefer to use npx):

npx @lightmill/convert-touchstone <input-file>

API

| Param | Type | Default | Description | | ------------------- | ----------------------------------------------------------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------- | | touchStoneXML | String | stream.Readable | | The XML to parse. | | [options] | object | | Options | | [options.preBlock] | string | object | array | function | | The type of the task to insert before each block or a function to map the block values to task(s). | | [options.postBlock] | string | object | array | function | | The type of the task to insert after each block or a function to map the block values to task(s). | | [options.preRun] | string | object | array | function | | The type of the task to insert before each run or a function to map the run values to task(s). | | [options.postRun] | string | object | array | function | | The type of the task to insert after each run or a function to map the run values to task(s). | | [options.trial] | string | object | array | function | "trial" | The type of the task to insert for each trial or a function to map the trial values to task(s). |

Example

// Map each run to a task to insert before the trials of the run.
const preRun = (run, experiment) => ({
  ...run,
  type: 'pre-run'
});
// Mappers can also be strings...
const postRun = 'post-run';  // This is the same as above.
// ...arrays (if several tasks need to be inserted)...
const preBlock = [
  { type: 'pre-block-1' },
  { type: 'pre-block-2' }
];
// ...or functions that returns arrays.
const postBlock = (block, run, experiment) => [
  { type: 'post-block-1', runId: run.id },
  { ...block , type: 'post-block-2' }
  'post-block-2' // This is the same as above.
];
convertTouchStone(data, { preBlock, postBlock, postRun, preRun })
  .then(doSomething);