Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radu-matei/vscode-exec
NodeJS helper library for executing binaries and handling output across Windows, macOS and WSL for VSCode
https://github.com/radu-matei/vscode-exec
Last synced: 19 days ago
JSON representation
NodeJS helper library for executing binaries and handling output across Windows, macOS and WSL for VSCode
- Host: GitHub
- URL: https://github.com/radu-matei/vscode-exec
- Owner: radu-matei
- License: mit
- Created: 2018-08-16T19:13:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T20:27:16.000Z (over 6 years ago)
- Last Synced: 2025-01-29T00:14:24.735Z (22 days ago)
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://opensource.org/licenses/MIT)
# Using this module in other modules
Here is a quick example of how this module can be used in other modules. The [TypeScript Module Resolution Logic](https://www.typescriptlang.org/docs/handbook/module-resolution.html) makes it quite easy. The file `src/index.ts` is a [barrel](https://basarat.gitbooks.io/typescript/content/docs/tips/barrel.html) that re-exports selected exports from other files. The _package.json_ file contains `main` attribute that points to the generated `lib/index.js` file and `typings` attribute that points to the generated `lib/index.d.ts` file.
> If you are planning to have code in multiple files (which is quite natural for a NodeJS module) that users can import, make sure you update `src/index.ts` file appropriately.
Now assuming you have published this amazing module to _npm_ with the name `my-amazing-lib`, and installed it in the module in which you need it -
- To use the `Greeter` class in a TypeScript file -
```ts
import { Greeter } from "my-amazing-lib";const greeter = new Greeter("World!");
greeter.greet();
```- To use the `Greeter` class in a JavaScript file -
```js
const Greeter = require('my-amazing-lib').Greeter;const greeter = new Greeter('World!');
greeter.greet();
```## Setting travis and coveralls badges
1. Sign in to [travis](https://travis-ci.org/) and activate the build for your project.
2. Sign in to [coveralls](https://coveralls.io/) and activate the build for your project.
3. Replace {{github-user-name}}/{{github-app-name}} with your repo details like: "ospatil/generator-node-typescript".