testing-pkp
v1.0.3
Published
steps to building npm packages
Downloads
14
Readme
Testing Project
This project demonstrates the steps to build and use an npm package. The package, named testing
, provides a simple helloWorld
function that returns the string "Hello, World!".
Project Structure
- index.js: Entry point of the project.
- package.json: Contains metadata about the project and its dependencies.
- test-package/: Directory containing test files.
- test-package/test.js: Test file that requires and uses the
testing
package.
Installation
To install the dependencies, run:
npm install
Usage
To use the helloWorld function from the testing package, you can require it in your JavaScript files:
const testing = require("testing");
console.log(testing.helloWorld());
Testing
To run the tests, execute:
cd test-package
node test.js
Development
To develop and test the package locally, follow these steps:
- Navigate to the package directory:
cd path/to/your/package
- Install the dependencies:
npm install
- Link the package globally:
npm link
- Navigate back to your project directory and link the
testing
package:
cd path/to/your/project
npm link testing
- Run the test script:
node test-package/test.js
License
This project is licensed under the ISC License - see the LICENSE file for details.
Author
Prince Kumar Prasad