svyat2027 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.js ADDED
@@ -0,0 +1,19 @@
1
+
2
+ var obj= require('./module');
3
+ console.log(`Hi ${obj.name} Penis!`);
4
+
5
+ var obj2= require('./module');
6
+ obj.name='Oleh';
7
+
8
+
9
+ console.log(`Hi ${obj.name} Penis!`);
10
+ console.log(`Hi ${obj2.name} Penis!`);
11
+
12
+
13
+
14
+ /* console.log(obj.number);
15
+ obj.test();
16
+
17
+ const os= require("os");
18
+ let userName=os.userInfo().username;
19
+ console.log(userName); */
package/app2.js ADDED
@@ -0,0 +1,4 @@
1
+
2
+ //module
3
+ const {add,sub}= require('./module2');
4
+ console.log(div(4,0));
package/app3.js ADDED
@@ -0,0 +1,14 @@
1
+ const lodash= require('lodash');
2
+ var users=[
3
+ {firstName: 'Oleh', age:19},
4
+ {firstName: 'Ann', age:20},
5
+ {firstName: 'Nastya', age:17},
6
+ {firstName: 'St3', age:10},
7
+
8
+
9
+
10
+ ]
11
+
12
+ var user= lodash.find(users, {firstName: 'Oleh', age:19});
13
+ console.log(user);
14
+
package/app4.js ADDED
@@ -0,0 +1 @@
1
+ console.log('Test module from npm')
package/app5.js ADDED
@@ -0,0 +1,28 @@
1
+
2
+
3
+
4
+ exports.isPrime= function isPrime(a){
5
+ if (a <= 1) console.log("not prime");
6
+ if (a === 2) console.log(" prime");
7
+ if (a % 2 === 0) console.log("not prime");
8
+
9
+ for (let i = 3; i <= Math.sqrt(a); i += 2) {
10
+ if (a % i === 0) console.log("not prime");;
11
+ }
12
+
13
+ console.log(" prime");
14
+ }
15
+
16
+ exports.factorial = function factorial(n){
17
+ if (n < 0) {
18
+ return "Error!";
19
+ } else if (n === 0 || n === 1) {
20
+ return 1;
21
+ } else {
22
+ let result = 1;
23
+ for (let i = 2; i <= n; i++) {
24
+ result *= i;
25
+ }
26
+ return result;
27
+ }
28
+ }
package/class.js ADDED
@@ -0,0 +1,3 @@
1
+ var obj= require("./app5");
2
+ console.log(obj.isPrime(5));
3
+ console.log(obj.factorial(5));
package/index.html ADDED
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Document</title>
7
+ </head>
8
+ <body>
9
+
10
+ </body>
11
+ </html>
package/module.js ADDED
@@ -0,0 +1,15 @@
1
+ /* let x =10;
2
+ function test(){
3
+ console.log('test');
4
+ }
5
+
6
+ module.exports={
7
+ number:x,
8
+ test:test
9
+ }; */
10
+
11
+ var name='Ann';
12
+ module.exports.name=name;
13
+
14
+
15
+
package/module2.js ADDED
@@ -0,0 +1,15 @@
1
+
2
+ exports.add=function add(a,b){
3
+ return a+b;
4
+ }
5
+ exports.sub=function sub(a,b){
6
+ return a-b;
7
+ }
8
+ exports.multiply=function multiply(a,b){
9
+ return a*b;
10
+ }
11
+ exports.div=function div(a,b){
12
+ if(b===0)
13
+ throw new Error("invalid number");
14
+ return a/b;
15
+ }
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "svyat2027",
3
+ "version": "1.0.0",
4
+ "description": "My module",
5
+ "main": "app5.js",
6
+ "author": "svyat",
7
+ "license": "MIT"
8
+
9
+ }