Giter Club home page Giter Club logo

Comments (2)

justin0022 avatar justin0022 commented on July 29, 2024

No problem, I’m happy to help.

To build the files (which takes the files in the source folder and outputs them to src), npm run build will work, which is equivalent to npm run build:cjs.

To run the example usage, create an index.js file in the root of the project, and then copy/paste the sample code into index.js:

const getSelf = require('./src/getSelf')
getSelf().then(x => console.log(x))

Then you should be able to run node index.js to execute the getSelf function.

The process for making new additions are:

  1. Add new file to source folder (say that the new file you want to add is ‘getUsersWithGradeThreshold.js`)
  2. In the source folder, there’s an index.js file that lists all of the files you want exported to src. There you will add: export { default as getUsersWithGradeThreshold } from './getUsersWithGradeThreshold'
  3. Run npm run build, which will build the project and output your new function into src.
  4. In the index.js at the root of the project that you create (this is not the index.js that’s in the source folder), import your new file from src like this: const getUsersWithGradeThreshold = require('.src/getUsersWithGradeThreshold') and test by running the code: node index.js.
  5. Once you’re happy that it works, create a PR.

Please feel free to make improvements to the README – I really appreciate it!

The entire process is a little cumbersome – the reason for this is because I wanted the package to be compatible with UMD and CJS and at the time this seemed like the best option. It’s copied from how Ramda had its package set up: https://github.com/ramda/ramda

Hope this helps. If you have any questions or need help let me know.

from node-canvas-api.

justin0022 avatar justin0022 commented on July 29, 2024

@KingPin1111 just wanted to follow up to see if I can close this issue now.

from node-canvas-api.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.