with-recording

0.0.1 • Public • Published

lesson-4

npm

Create an npm package with our super test helper!

Workflow

  1. To initialize package type npm init and follow the commands.
  2. Create an index.js file exporting an example function:
export function example() {
  return 5;
}
  1. Try to run code with node index.js. What's wrong?
  2. Convert export to old syntax. (New one is still not fully supported across packages).
function example() { // don't use the export keyword. It's not supported in node.
  return 5;
}

module.exports = { // to export function use module.exports rather than export keyword
  example
};
  1. Publicate the package.

Readme

Keywords

none

Package Sidebar

Install

npm i with-recording

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

1.28 kB

Total Files

3

Last publish

Collaborators

  • michalwarda