with-recording
v0.0.1
Published
Automatically record your requests using nock.
Downloads
1
Readme
lesson-4
npm
Create an npm package with our super test helper!
Workflow
- To initialize package type
npm init
and follow the commands. - Create an index.js file exporting an example function:
export function example() {
return 5;
}
- Try to run code with
node index.js
. What's wrong? - 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
};
- Publicate the package.