Skip to content
eln / 0.0.3-alpha.29

eln 0.0.3-alpha.29

Install from the command line:
Learn more about npm packages
$ npm install @cdd/eln@0.0.3-alpha.29
Install via package.json:
"@cdd/eln": "0.0.3-alpha.29"

About this version

Entry

How to inject local frontend on prod

  • In terminal run yarn serve -- --env INJECT_BUILD=1.
  • Install TamperMonkey chrome extension. Allow it to execute in Incognito mode.
  • Add tampermonkey/prodInject.js script from repository to your Tampermonkey as a new script.
  • Go to url like https://app.collaborativedrug.com/vaults/<project_id>/eln/entries/<entry_id> in Chrome incognito mode.
  • To check that everything is working, you can find in Inspector div id="elnEntry". Its only child should have class injected.

Installation

To install this package, you need to set up your project to download packages from GitHub Packages. Here is the step-by-step guide:

  1. First, you need to create a personal access token in GitHub.
    • Go to your GitHub Settings (click your profile picture in the top right > Settings)
    • On the left sidebar, click "Developer Settings"
    • Click "Personal access tokens"
    • Click "Generate new token"
    • Give your token a name, and check the box "read:packages"
    • Click "Generate token" at the bottom

Note: Be sure to copy the token now. You will not be able to see it again!

  1. Create or modify the .npmrc file in your project root directory (or your home directory, if you want to use it for all your projects). The file should contain the following lines:
registry=https://registry.npmjs.org/
@cdd:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

Set your environment variable GITHUB_TOKEN to the personal access token you just created. Please note that the environment variable should be set in the environment where npm/yarn commands are run.

Unix-based example:

export GITHUB_TOKEN="your-token-goes-here"
  1. Now you are ready to install the package. You can use either yarn or npm:
yarn add @cdd/eln

or

npm install @cdd/eln

Usage

After installation, you can import the package in your JavaScript (or TypeScript) code:

const ElnEntry = require("@cdd/eln");

Or with ES6 import:

import { someFunction } from "@cdd/eln";