{"_id":"@appelent/node-enelogic","_rev":"1-0b00796029109c933ccd47e69b301e49","name":"@appelent/node-enelogic","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@appelent/node-enelogic","version":"0.1.1","description":"Enelogic SDK","main":"lib/index.js","types":"lib/index.d.ts","license":"MIT","scripts":{"type-check":"tsc --noEmit","type-check:watch":"npm run type-check -- --watch","build":"npm run build:types && npm run build:js","build:types":"tsc --emitDeclarationOnly","build:js":"babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline","test":"jest --config jestconfig.json","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","prepare":"npm run build","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.4.0","@babel/plugin-proposal-class-properties":"^7.4.0","@babel/plugin-proposal-numeric-separator":"^7.2.0","@babel/plugin-proposal-object-rest-spread":"^7.4.0","@babel/preset-env":"^7.4.1","@babel/preset-typescript":"^7.3.3","@types/jest":"^24.0.24","jest":"^24.9.0","prettier":"^1.19.1","ts-jest":"^24.2.0","tslint":"^5.20.1","tslint-config-prettier":"^1.18.0","typescript":"^3.7.3"},"gitHead":"2320c01dd7bf0868d9ac9cd0283f1c98f7c5ceb0","_id":"@appelent/node-enelogic@0.1.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ue2Vj9RHFLyaXxc0SJV38rN1dfNE0Q6P4rhB4zgq5qziTNyJFxDJnoZDQ3D+d8mrJ78TrL3I14H85D14iVi5gg==","shasum":"d5ac70538908b394f97d7df84e3f95cccc831da3","tarball":"https://registry.npmjs.org/@appelent/node-enelogic/-/node-enelogic-0.1.1.tgz","fileCount":5,"unpackedSize":12140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/I5UCRA9TVsSAnZWagAAo44P/0icGSnBna+Vo04D1bzu\npGP4/kKLzrN2bcstFsMdq1PoKiPeUfFSfpfejWvK/Vzfd/Sn1LC4mDYXIv0p\nB5ginHTyi8oijXlllQWniGI1b++C9d3IH/KtvFcwz6juMqgYNnxvU6PkLKPC\nFI5xcXYCZEBSRlQ+9p+YBqBDGcUWU6xW0w94ppPijqQfBF/4KXEEmJKA/FV1\nNrirlqZp2Sp4z9MkagAQkdSKf2EJ5f0uEhxoKssSPOIMxeFIAZOGdwRoMjQH\nHlbM2zU5MZq/BU9BypPH7YWY1xmwwuo8ttzhe9EbQvAKaT5O+3akr4Jb02TW\n7V24ao+NYGxgxT4fN8WmdPewuMpoEPyvzJ37Nkx3spMnROXbbZ/sC60JfPLY\nZBKyy3sj+g1F84OPtc07YHEOk3ehvtcOS/67TmAUWWF0yiOeZnEtlXcfMkCi\nUHWtq7x2XbUn12pYxbbEcXfQCQF4SI8fKdXOCKl3dazGFI0iJMhwXfBF2iIR\naV2XJD+n6uXpbTS30gfakYATpgK/Zg6gpOQLwQmA3dlbZPFzGHcCREt0X2+u\nJibsFS5Clf52ctBO2swFqmGAxXSnfQheUEmBeDdjBEtOpCq2M3FzDntlSgTh\nZxJmGBlMgVzxU+JFx3TR9YX+Th/x5voiBxWK9EFYAMQjGDJEedDpeDwtOPiX\nmDjT\r\n=bHX+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2+Nm1qsS5QXeYC1JYppUyorHFanMWTJIzNtRHTaIGzQIgaHlFezp2N8URePBTeaZ40zkIcKx8Lq8MNP1m2McT+78="}]},"maintainers":[{"name":"ericjansen","email":"ericjansen@live.nl"}],"_npmUser":{"name":"ericjansen","email":"ericjansen@live.nl"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-enelogic_0.1.1_1576832596431_0.20443021291303665"},"_hasShrinkwrap":false}},"time":{"created":"2019-12-20T09:03:16.186Z","0.1.1":"2019-12-20T09:03:16.542Z","modified":"2022-04-04T14:49:23.315Z"},"maintainers":[{"name":"ericjansen","email":"ericjansen@live.nl"}],"description":"Enelogic SDK","license":"MIT","readme":"# TypeScript-Babel-Starter\r\n\r\n# What is this?\r\n\r\nThis is a small sample repository that uses Babel to transform TypeScript to plain JavaScript, and uses TypeScript for type-checking.\r\nThis README will also explain step-by-step how you can set up this repository so you can understand how each component fits together.\r\n\r\nFor simplicity, we've used `babel-cli` with a bare-bones TypeScript setup, but we'll also demonstrate integration with JSX/React, as well as adding bundlers into the mix.\r\nSpecifically, we'll show off integration with Webpack for if you're deploying an application, and Rollup for if you're producing a library.\r\n\r\n# How do I use it?\r\n\r\n## Building the repo\r\n\r\n```sh\r\nnpm run build\r\n```\r\n\r\n## Type-checking the repo\r\n\r\n```sh\r\nnpm run type-check\r\n```\r\n\r\nAnd to run in `--watch` mode:\r\n\r\n```sh\r\nnpm run type-check:watch\r\n```\r\n\r\n# How would I set this up myself?\r\n\r\n## Install your dependencies\r\n\r\nEither run the following:\r\n\r\n```sh\r\nnpm install --save-dev typescript @babel/core @babel/cli @babel/plugin-proposal-class-properties @babel/plugin-proposal-object-rest-spread @babel/preset-env @babel/preset-typescript @babel/plugin-proposal-numeric-separator\r\n```\r\n\r\nor make sure that you add the appropriate `\"devDependencies\"` entries to your `package.json` and run `npm install`:\r\n\r\n```json\r\n\"devDependencies\": {\r\n    \"@babel/cli\": \"^7.2.3\",\r\n    \"@babel/core\": \"^7.4.0\",\r\n    \"@babel/plugin-proposal-class-properties\": \"^7.4.0\",\r\n    \"@babel/plugin-proposal-object-rest-spread\": \"^7.4.0\",\r\n    \"@babel/plugin-proposal-numeric-separator\": \"^7.2.0\",\r\n    \"@babel/preset-env\": \"^7.4.1\",\r\n    \"@babel/preset-typescript\": \"^7.3.2\",\r\n    \"typescript\": \"^3.3.3\"\r\n}\r\n```\r\n\r\n## Create your `tsconfig.json`\r\n\r\nThen run\r\n\r\n```sh\r\ntsc --init --declaration --allowSyntheticDefaultImports --target esnext --outDir lib\r\n```\r\n\r\n**Note:** TypeScript also provides a `--declarationDir` option which specifies an output directory for generated declaration files (`.d.ts` files).\r\nFor our uses where `--emitDeclarationOnly` is turned on, `--outDir` works equivalently.\r\n\r\n## Create your `.babelrc`\r\n\r\nThen copy the `.babelrc` in this repo, or the below:\r\n\r\n```json\r\n{\r\n    \"presets\": [\r\n        \"@babel/env\",\r\n        \"@babel/typescript\"\r\n    ],\r\n    \"plugins\": [\r\n        \"@babel/proposal-class-properties\",\r\n        \"@babel/proposal-object-rest-spread\"\r\n    ]\r\n}\r\n```\r\n\r\n## Set up your build tasks\r\n\r\nAdd the following to the `\"scripts\"` section of your `package.json`\r\n\r\n```json\r\n\"scripts\": {\r\n    \"type-check\": \"tsc --noEmit\",\r\n    \"type-check:watch\": \"npm run type-check -- --watch\",\r\n    \"build\": \"npm run build:types && npm run build:js\",\r\n    \"build:types\": \"tsc --emitDeclarationOnly\",\r\n    \"build:js\": \"babel src --out-dir lib --extensions \\\".ts,.tsx\\\" --source-maps inline\"\r\n}\r\n```\r\n\r\n# How do I change it?\r\n\r\n## Using JSX (and React)\r\n> Full example available [**here**](https://github.com/a-tarasyuk/react-webpack-typescript-babel)\r\n\r\n### Install your dependencies\r\n\r\nInstall the [@babel/preset-react](https://www.npmjs.com/package/@babel/preset-react) package as well as React, ReactDOM, and their respective type declarations\r\n\r\n```sh\r\nnpm install --save react react-dom @types/react @types/react-dom\r\nnpm install --save-dev @babel/preset-react@7.0.0\r\n```\r\n\r\n### Update `.babelrc`\r\n\r\nThen add `\"@babel/react\"` as one of the presets in your `.babelrc`.\r\n\r\n### Update `tsconfig.json`\r\n\r\nUpdate your `tsconfig.json` to set `\"jsx\"` to `\"react\"`.\r\n\r\n### Use a `.tsx` file\r\n\r\nMake sure that any files that contain JSX use the `.tsx` extension.\r\nTo get going quickly, just rename `src/index.ts` to `src/index.tsx`, and add the following lines to the bottom:\r\n\r\n```ts\r\nimport React from 'react';\r\nexport let z = <div>Hello world!</div>;\r\n```\r\n\r\n## Using Webpack\r\n\r\n> Full example available [**here**](https://github.com/a-tarasyuk/webpack-typescript-babel)\r\n\r\n### Install your dependencies\r\n\r\n```sh\r\nnpm install --save-dev webpack webpack-cli babel-loader@8.0.4\r\n```\r\n\r\n### Create a `webpack.config.js`\r\n\r\nCreate a `webpack.config.js` at the root of this project with the following contents:\r\n\r\n```js\r\nvar path = require('path');\r\n\r\nmodule.exports = {\r\n    // Change to your \"entry-point\".\r\n    entry: './src/index',\r\n    output: {\r\n        path: path.resolve(__dirname, 'dist'),\r\n        filename: 'app.bundle.js'\r\n    },\r\n    resolve: {\r\n        extensions: ['.ts', '.tsx', '.js', '.json']\r\n    },\r\n    module: {\r\n        rules: [{\r\n            // Include ts, tsx, js, and jsx files.\r\n            test: /\\.(ts|js)x?$/,\r\n            exclude: /node_modules/,\r\n            loader: 'babel-loader',\r\n        }],\r\n    }\r\n};\r\n```\r\n\r\n### Create a build task\r\n\r\nAdd\r\n\r\n```json\r\n\"bundle\": \"webpack\"\r\n```\r\n\r\nto the `scripts` section in your `package.json`.\r\n\r\n### Run the build task\r\n\r\n```sh\r\nnpm run bundle\r\n```\r\n\r\n## Using Rollup\r\n\r\n> Full example available [**here**](https://github.com/a-tarasyuk/rollup-typescript-babel)\r\n\r\n### Install your dependencies\r\n\r\n```sh\r\nnpm install --save-dev rollup rollup-plugin-babel@latest rollup-plugin-node-resolve rollup-plugin-commonjs\r\n```\r\n\r\n### Create a `rollup.config.js`\r\n\r\nCreate a `rollup.config.js` at the root of this project with the following contents:\r\n\r\n```js\r\nimport commonjs from 'rollup-plugin-commonjs';\r\nimport resolve from 'rollup-plugin-node-resolve';\r\nimport babel from 'rollup-plugin-babel';\r\nimport pkg from './package.json';\r\n\r\nconst extensions = [\r\n  '.js', '.jsx', '.ts', '.tsx',\r\n];\r\n\r\nconst name = 'RollupTypeScriptBabel';\r\n\r\nexport default {\r\n  input: './src/index.ts',\r\n\r\n  // Specify here external modules which you don't want to include in your bundle (for instance: 'lodash', 'moment' etc.)\r\n  // https://rollupjs.org/guide/en#external-e-external\r\n  external: [],\r\n\r\n  plugins: [\r\n    // Allows node_modules resolution\r\n    resolve({ extensions }),\r\n\r\n    // Allow bundling cjs modules. Rollup doesn't understand cjs\r\n    commonjs(),\r\n\r\n    // Compile TypeScript/JavaScript files\r\n    babel({ extensions, include: ['src/**/*'] }),\r\n  ],\r\n\r\n  output: [{\r\n    file: pkg.main,\r\n    format: 'cjs',\r\n  }, {\r\n    file: pkg.module,\r\n    format: 'es',\r\n  }, {\r\n    file: pkg.browser,\r\n    format: 'iife',\r\n    name,\r\n\r\n    // https://rollupjs.org/guide/en#output-globals-g-globals\r\n    globals: {},\r\n  }],\r\n};\r\n\r\n```\r\n\r\n### Create a build task\r\n\r\nAdd\r\n\r\n```json\r\n\"bundle\": \"rollup -c\"\r\n```\r\n\r\nto the `scripts` section in your `package.json`.\r\n\r\n### Run the build task\r\n\r\n```sh\r\nnpm run bundle\r\n```\r\n","readmeFilename":"README.md"}