elven-code

4.14.2 • Public • Published

Elven Code

These are utility functions that Charlie commonly uses or that he shares with his students.

Usage

import { elfUtils, elfStrings, elfFiles } from 'elven-code';
const { elfUtils, elfStrings, elfFiles } = require('elven-code');
const key = elfStrings.getEndFromCharacter(dir, '/');
const content = elfFiles.readFile(fileName);
console.log(key, content);

Notes

Meant to be used on the server side. Webpack and create-react-app will complain If you target the client. For a solution, see: https://stackoverflow.com/q/64557638/253576.

Install:

npm i elven-code

Testing

To test all the files requires some setup and can best be done on Charlie's machines. In particular, you need:

  • ElvenConfig.json in ~/.config

To install the Git Repository called test-dummy:

To run all the tests requires setup:

npm test

To run some utils might work without setup:

  • npm run test-files
  • npm run test-strings

The config file might look like this:

{
    "calvert": {
        "base-dir": "/home/charlie/",
        "site-dirs": [
          "Documents/AllTest",
          "Git/CloudNotes/Assignments",
          "Git/CloudNotes/Prog270",
          "Git/CloudNotes/Isit322"
        ]
    }
}

https://www.elvenware.com/teach/assignments/NpmPublishing.html

Readme

Keywords

Package Sidebar

Install

npm i elven-code

Weekly Downloads

3

Version

4.14.2

License

MIT

Unpacked Size

127 kB

Total Files

69

Last publish

Collaborators

  • charliecalvert