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

@iebh/tera-fy

v1.15.3

Published

TERA website worker

Downloads

522

Readme

TERA-fy

TERA website worker, intended to be embedded with TERA tools.

TERA-fy is a add-on module which extends 3rd party tools with functionality from the TERA project. It provides various functionality like data sync with the parent TERA instance, file upload/download, citation library access and other utilities.

Quick Start

import TeraFy from '@iebh/tera-fy';
import TerafyVue from '@iebh/tera-fy/plugins/vue';
let terafy = new TeraFy()
	.set('devMode', true) // Set this option to see debugging messages
	.use(TerafyVue); // Add the Vue plugin

// Initialize everything
await terafy.init();

// Require that the active session has a project selected
await terafy.requireProject();

// Go fetch the state of the active project
let projectState = await terafy.getProjectState(); //= Object representing the active project

// See https://iebh.github.io/TERA-fy/ for a full API list

Included Files

Generally importing the source code TERA-fy client (import terafy from '@iebh/tera-fy';) should be sufficient but multiple versions of this client are shipped for compatibility with older or more annoying build systems:

| Import | Standard | Description | |--------------------------------------------|--------------|--------------------------------------------------------------------| | @iebh/tera-fy | Source Code | Basic, plain JS to be transformed however your build path requires | | @iebh/tera-fy/dist/terafy.es2019.js | ESM + ES2019 | @vue/cli-service compatible version for older versions of Babel | | @iebh/tera-fy/dist/plugin.vue2.es2019.js | ESM + ES2019 | @vue/cli-service compatible version of the Vue@2 plugin |

More versions can be added upon request or PR of the build command in the scripts section of package.json.

Plugins

This module exports various plugins which are availble as import from '@iebh/tera-fy/plugins/*'.

@iebh/tera-fy/plugins/vue2

FIXME: To add documentation

@iebh/tera-fy/plugins/vue3

FIXME: To add documentation

@iebh/tera-fy/plugins/vite

A plugin for Vite which boots a local proxy server to route traffic to/from localhost:7334 to tera-tools.com. This is to work around the issue where a local website is usually forbidden from talking to TERA-tools.com unless its running with a HTTPS context.

Example Usage within vite.config.js:

// ... Other imports ... //
import pluginTeraFy from '@iebh/tera-fy/plugins/vite';

export default {
	plugins: [
		// ... other plugin config ... //

		pluginTeraFy(), // ... or add an options object to override the defaults
	],
}

Configuration options:

| Option | Type | Default | Description | |------------------|-----------|--------------------|----------------------------------------------------------------| | force | Boolean | false | Restart the server even if its apparently running | | autoStart | Boolean | true | Automatically start the proxy without calling Plugin.start() | | host | String | '0.0.0.0' | Host IP to listen on | | port | Number | 7334 | Host port to listen on | | targetProtocol | String | 'https' | Target protocol to forward to | | targetHost | String | 'tera-tools.com' | Target host to forward to | | targetPort | Number | 443 | Target port to forward to |