chore(i18n,curriculum): update translations (#43988)

pull/43988/merge
camperbot 2021-10-24 20:56:40 -07:00 committed by GitHub
parent f5ccaf971b
commit 33c095a415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 499 additions and 141 deletions

View File

@ -1,6 +1,6 @@
--- ---
id: 5a8b073d06fa14fcfde687aa id: 5a8b073d06fa14fcfde687aa
title: Exercise Tracker title: Rastreador de ejercicios
challengeType: 4 challengeType: 4
forumTopicId: 301505 forumTopicId: 301505
dashedName: exercise-tracker dashedName: exercise-tracker
@ -8,17 +8,59 @@ dashedName: exercise-tracker
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://exercise-tracker.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://exercise-tracker.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/) y completa tu proyecto localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker) to complete your project. - Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--
Tus respuestas deben tener las siguientes estructuras.
Ejercicio:
```js
{
username: "fcc_test"
description: "test",
duration: 60,
date: "Mon Jan 01 1990",
_id: "5fb5853f734231456ccb3b05"
}
```
Usuario:
```js
{
username: "fcc_test",
_id: "5fb5853f734231456ccb3b05"
}
```
Log:
```js
{
username: "fcc_test",
count: 1,
_id: "5fb5853f734231456ccb3b05",
log: [{
description: "test",
duration: 60,
date: "Mon Jan 01 1990",
}]
}
```
**Pista:** Para la propiedad `date`, el método `toDateString` de la API `Date` puede ser usado para conseguir el resultado esperado.
# --hints-- # --hints--
You should provide your own project, not the example URL. Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -29,7 +71,24 @@ You should provide your own project, not the example URL.
}; };
``` ```
You can `POST` to `/api/users` with form data `username` to create a new user. The returned response will be an object with `username` and `_id` properties. Puedes hacer una petición `POST` a `/api/users` con los datos de formulario que tenga la propiedad `username` para crear un nuevo usuario.
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
assert.isTrue(res.ok);
if(!res.ok) {
throw new Error(`${res.status} ${res.statusText}`)
};
};
```
La respuesta devuelta de `POST /api/users` con datos de formulario `username` será un objeto con propiedades `username` y `_id`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -49,24 +108,89 @@ async (getUserInput) => {
}; };
``` ```
You can make a `GET` request to `/api/users` to get an array of all users. Each element in the array is an object containing a user's `username` and `_id`. Puedes hacer una petición `GET` a `/api/users` para obtener una lista con todos los usuarios.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users');
assert.isTrue(res.ok);
if(!res.ok) {
throw new Error(`${res.status} ${res.statusText}`)
};
};
```
La petición `GET` a `/api/users` devuelve un arreglo.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users');
if(res.ok){
const users = await res.json();
assert.isArray(users);
} else {
throw new Error(`${res.status} ${res.statusText}`);
};
};
```
Cada elemento en el arreglo devuelto desde `GET /api/users` es un literal de objeto que contiene el `username` y `_id`.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users');
if(res.ok){
const users = await res.json();
const user = users[0];
assert.exists(user);
assert.exists(user.username);
assert.exists(user._id);
assert.isString(user.username);
assert.isString(user._id);
} else {
throw new Error(`${res.status} ${res.statusText}`);
};
};
```
Puedes hacer una petición `POST` a `/api/users/:_id/exercises` con datos de formulario `description`, `duration`, y opcionalmente `date`. Si no se proporciona ninguna fecha, se utilizará la fecha actual.
```js ```js
async (getUserInput) => { async (getUserInput) => {
const url = getUserInput('url'); const url = getUserInput('url');
const res = await fetch(url + '/api/users'); const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if (res.ok) { if (res.ok) {
const data = await res.json(); const { _id, username } = await res.json();
assert.isArray(data); const expected = {
assert.isString(data[0].username); username,
assert.isString(data[0]._id); description: 'test',
duration: 60,
_id,
date: 'Mon Jan 01 1990'
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
assert.isTrue(addRes.ok);
if(!addRes.ok) {
throw new Error(`${addRes.status} ${addRes.statusText}`)
};
} else { } else {
throw new Error(`${res.status} ${res.statusText}`); throw new Error(`${res.status} ${res.statusText}`);
} }
}; };
``` ```
You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used. The response returned will be the user object with the exercise fields added. La respuesta devuelta desde `POST /api/users/:_id/exercises` será el objeto de usuario con los campos de ejercicio añadidos.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -93,6 +217,9 @@ async (getUserInput) => {
if (addRes.ok) { if (addRes.ok) {
const actual = await addRes.json(); const actual = await addRes.json();
assert.deepEqual(actual, expected); assert.deepEqual(actual, expected);
assert.isString(actual.description);
assert.isNumber(actual.duration);
assert.isString(actual.date);
} else { } else {
throw new Error(`${addRes.status} ${addRes.statusText}`); throw new Error(`${addRes.status} ${addRes.statusText}`);
} }
@ -102,7 +229,7 @@ async (getUserInput) => {
}; };
``` ```
You can make a `GET` request to `/api/users/:_id/logs` to retrieve a full exercise log of any user. The returned response will be the user object with a `log` array of all the exercises added. Each log item has the `description`, `duration`, and `date` properties. Puedes hacer una petición `GET` a `/api/users/:_id/logs` para recuperar un log completo del ejercicio de cualquier usuario.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -128,13 +255,10 @@ async (getUserInput) => {
}); });
if (addRes.ok) { if (addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`); const logRes = await fetch(url + `/api/users/${_id}/logs`);
if (logRes.ok) { assert.isTrue(logRes.ok);
const { log } = await logRes.json(); if(!logRes.ok) {
assert.isArray(log); throw new Error(`${logRes.status} ${logRes.statusText}`)
assert.equal(1, log.length); };
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else { } else {
throw new Error(`${addRes.status} ${addRes.statusText}`); throw new Error(`${addRes.status} ${addRes.statusText}`);
} }
@ -144,7 +268,7 @@ async (getUserInput) => {
}; };
``` ```
A request to a user's log (`/api/users/:_id/logs`) returns an object with a `count` property representing the number of exercises returned. Una solicitud al log de un usuario `GET /api/users/:_id/logs` devuelve un objeto de usuario con una propiedad `count` representando el número de ejercicios que pertenecen a ese usuario.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -185,7 +309,239 @@ async (getUserInput) => {
}; };
``` ```
You can add `from`, `to` and `limit` parameters to a `/api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back. Una solicitud `GET` a `/api/users/:id/logs` devolverá el objeto de usuario con un arreglo `log` de todos los ejercicios añadidos.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
})
if(res.ok){
const {_id, username} = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `description=${expected.description}&duration=${expected.duration}`
});
if(addRes.ok){
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if(logRes.ok) {
const {log} = await logRes.json();
assert.isArray(log);
assert.equal(1, log.length);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
};
} else {
throw new Error(`${res.status} ${res.statusText}`)
};
};
```
Cada elemento en el arreglo `log` que es devuelto desde `GET /api/users/:id/logs` es un objeto que debe tener las propiedades `description`, `duration` y `date`.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + `/api/users`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if(res.ok) {
const {_id, username} = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `description=${expected.description}&duration=${expected.duration}`
});
if(addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if(logRes.ok) {
const {log} = await logRes.json();
const exercise = log[0];
assert.exists(exercise);
assert.exists(exercise.description);
assert.exists(exercise.duration);
assert.exists(exercise.date);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
};
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
};
} else {
throw new Error(`${res.status} ${res.statusText}`)
};
};
```
La propiedad `description` de cualquier objeto en el arreglo `log` que es devuelto desde `GET /api/users/:id/logs` debe ser una cadena.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users/', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `username=fcc_test_${Date.now()}`.substr(0,29)
});
if(res.ok) {
const {_id, username} = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `description=${expected.description}&duration=${expected.duration}`
});
if(addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if(logRes.ok){
const {log} = await logRes.json();
const exercise = log[0];
assert.isString(exercise.description);
assert.equal(exercise.description, expected.description);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
};
} else {
throw new Error(`${res.status} ${res.statusText}`);
};
};
```
La propiedad `duration` de cualquier objeto en el arreglo `log` que es devuelto desde `GET /api/users/:id/logs` debe ser un número.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users/', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `username=fcc_test_${Date.now()}`.substr(0,29)
});
if(res.ok) {
const {_id, username} = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `description=${expected.description}&duration=${expected.duration}`
});
if(addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if(logRes.ok){
const {log} = await logRes.json();
const exercise = log[0];
assert.isNumber(exercise.duration);
assert.equal(exercise.duration, expected.duration);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
};
} else {
throw new Error(`${res.status} ${res.statusText}`);
};
};
```
La propiedad `date` de cualquier objeto en el arrelgo `log` que es devuelto desde `GET /api/users/:id/logs` debe ser una cadena.. Utiliza el formato `dateString` de la API `Date`.
```js
async(getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/users/', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `username=fcc_test_${Date.now()}`.substr(0,29)
});
if(res.ok) {
const {_id, username} = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `description=${expected.description}&duration=${expected.duration}`
});
if(addRes.ok) {
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if(logRes.ok){
const {log} = await logRes.json();
const exercise = log[0];
assert.isString(exercise.date);
assert.equal(exercise.date, expected.date);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
};
} else {
throw new Error(`${res.status} ${res.statusText}`);
};
};
```
Puedes añadir parámetros `from`, `to` y `limit` a una petición `GET /api/users/:_id/logs` para recuperar parte del log de cualquier usuario. `from` y `to` son fechas en formato `yyyy-mm-dd`. `limit` es un número entero de cuántos logs hay que devolver.
```js ```js
async (getUserInput) => { async (getUserInput) => {

View File

@ -1,6 +1,6 @@
--- ---
id: bd7158d8c443edefaeb5bd0f id: bd7158d8c443edefaeb5bd0f
title: File Metadata Microservice title: Microservicio de metadatos de archivo
challengeType: 4 challengeType: 4
forumTopicId: 301506 forumTopicId: 301506
dashedName: file-metadata-microservice dashedName: file-metadata-microservice
@ -8,21 +8,21 @@ dashedName: file-metadata-microservice
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://file-metadata-microservice.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://file-metadata-microservice.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) y completa tu proyecto localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata) to complete your project. - Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your projects source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions-- # --instructions--
**HINT:** You can use the `multer` npm package to handle file uploading. **NOTA:** Puedes usar el paquete npm `multer` para gestionar la carga de archivos.
# --hints-- # --hints--
You should provide your own project, not the example URL. Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -34,7 +34,7 @@ You should provide your own project, not the example URL.
}; };
``` ```
You can submit a form that includes a file upload. Puedes enviar un formulario que incluya una carga de archivo.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -45,7 +45,7 @@ async (getUserInput) => {
}; };
``` ```
The form file input field has the `name` attribute set to `upfile`. El campo de entrada del archivo de formulario tiene el atributo `name` establecido a `upfile`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -56,7 +56,7 @@ async (getUserInput) => {
}; };
``` ```
When you submit a file, you receive the file `name`, `type`, and `size` in bytes within the JSON response. Cuando envíes un archivo, recibirá el `name` del archivo, `type` y `size` en bytes dentro de la respuesta JSON.
```js ```js
async (getUserInput) => { async (getUserInput) => {

View File

@ -1,6 +1,6 @@
--- ---
id: bd7158d8c443edefaeb5bdff id: bd7158d8c443edefaeb5bdff
title: Request Header Parser Microservice title: Microservicio de analizador de solicitud de encabezado
challengeType: 4 challengeType: 4
forumTopicId: 301507 forumTopicId: 301507
dashedName: request-header-parser-microservice dashedName: request-header-parser-microservice
@ -8,17 +8,17 @@ dashedName: request-header-parser-microservice
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://request-header-parser-microservice.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://request-header-parser-microservice.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-headerparser/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-headerparser/) y completa tu proyecto localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser) to complete your project. - Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --hints-- # --hints--
You should provide your own project, not the example URL. Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -30,7 +30,7 @@ You should provide your own project, not the example URL.
}; };
``` ```
A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key. Una petición a `/api/whoami` debe devolver un objeto JSON con tu dirección IP en la clave `ipaddress`.
```js ```js
(getUserInput) => (getUserInput) =>
@ -42,7 +42,7 @@ A request to `/api/whoami` should return a JSON object with your IP address in t
); );
``` ```
A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key. Una petición a `/api/whoami` debe devolver un objeto JSON con tu idioma preferido en la clave `language`.
```js ```js
(getUserInput) => (getUserInput) =>
@ -54,7 +54,7 @@ A request to `/api/whoami` should return a JSON object with your preferred langu
); );
``` ```
A request to `/api/whoami` should return a JSON object with your software in the `software` key. Una petición a `/api/whoami` debe devolver un objeto JSON con tu software en la clave de `software`.
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: bd7158d8c443edefaeb5bdef id: bd7158d8c443edefaeb5bdef
title: Timestamp Microservice title: Microservicio de marca de tiempo
challengeType: 4 challengeType: 4
forumTopicId: 301508 forumTopicId: 301508
dashedName: timestamp-microservice dashedName: timestamp-microservice
@ -8,17 +8,17 @@ dashedName: timestamp-microservice
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://timestamp-microservice.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://timestamp-microservice.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) y completa tu proyecto localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp) to complete your project. - Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your projects source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --hints-- # --hints--
You should provide your own project, not the example URL. Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -28,7 +28,7 @@ You should provide your own project, not the example URL.
}; };
``` ```
A request to `/api/:date?` with a valid date should return a JSON object with a `unix` key that is a Unix timestamp of the input date in milliseconds Una solicitud para `/api/:date?` con una fecha válida debe devolver un objeto JSON con una clave `unix` que es una marca de tiempo Unix de la fecha de entrada en milisegundos
```js ```js
(getUserInput) => (getUserInput) =>
@ -46,7 +46,7 @@ A request to `/api/:date?` with a valid date should return a JSON object with a
); );
``` ```
A request to `/api/:date?` with a valid date should return a JSON object with a `utc` key that is a string of the input date in the format: `Thu, 01 Jan 1970 00:00:00 GMT` Una petición para `/api/:date?` con una fecha válida debe devolver un objeto JSON con una clave `utc` que es una cadena de la fecha de entrada en el formato: `Thu, 01 Jan 1970 00:00:00 GMT`
```js ```js
(getUserInput) => (getUserInput) =>
@ -64,7 +64,7 @@ A request to `/api/:date?` with a valid date should return a JSON object with a
); );
``` ```
A request to `/api/1451001600000` should return `{ unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }` Una petición a `/api/1451001600000` debe devolver `{ unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }`
```js ```js
(getUserInput) => (getUserInput) =>
@ -81,7 +81,7 @@ A request to `/api/1451001600000` should return `{ unix: 1451001600000, utc: "Fr
); );
``` ```
Your project can handle dates that can be successfully parsed by `new Date(date_string)` Tu proyecto puede manejar fechas que pueden ser analizadas con éxito por `new Date(date_string)`
```js ```js
(getUserInput) => (getUserInput) =>
@ -98,7 +98,7 @@ Your project can handle dates that can be successfully parsed by `new Date(date_
); );
``` ```
If the input date string is invalid, the api returns an object having the structure `{ error : "Invalid Date" }` Si la fecha de entrada no es válida, la api devuelve un objeto con la estructura `{ error : "Invalid Date" }`
```js ```js
(getUserInput) => (getUserInput) =>
@ -112,7 +112,7 @@ If the input date string is invalid, the api returns an object having the struct
); );
``` ```
An empty date parameter should return the current time in a JSON object with a `unix` key Un parámetro de fecha vacío debe devolver la hora actual en un objeto JSON con una clave `unix`
```js ```js
(getUserInput) => (getUserInput) =>
@ -127,7 +127,7 @@ An empty date parameter should return the current time in a JSON object with a `
); );
``` ```
An empty date parameter should return the current time in a JSON object with a `utc` key Un parámetro de fecha vacío debe devolver la hora actual en un objeto JSON con una clave `utc`
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: bd7158d8c443edefaeb5bd0e id: bd7158d8c443edefaeb5bd0e
title: URL Shortener Microservice title: Microservicio acortador de URL
challengeType: 4 challengeType: 4
forumTopicId: 301509 forumTopicId: 301509
dashedName: url-shortener-microservice dashedName: url-shortener-microservice
@ -8,21 +8,21 @@ dashedName: url-shortener-microservice
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://url-shortener-microservice.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://url-shortener-microservice.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-urlshortener/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-urlshortener/) y completa tu proyecto localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener) to complete your project. - Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your projects source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions-- # --instructions--
**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL. **NOTA:** No olvides usar un middleware para manejar las peticiones POST. También, puedes usar la función `dns.lookup(host, cb)` desde el módulo principal `dns` para verificar una URL enviada.
# --hints-- # --hints--
You should provide your own project, not the example URL. Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -34,7 +34,7 @@ You should provide your own project, not the example URL.
}; };
``` ```
You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` Puedes publicar una URL en `/api/shorturl` y obtener una respuesta JSON con las propiedades `original_url` y `short_url`. Aquí hay un ejemplo: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}`
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -56,7 +56,7 @@ async (getUserInput) => {
}; };
``` ```
When you visit `/api/shorturl/<short_url>`, you will be redirected to the original URL. Cuando visitas `/api/shorturl/<short_url>`, serás redirigido a la URL original.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -88,7 +88,7 @@ async (getUserInput) => {
}; };
``` ```
If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` Si pasas una URL inválida que no sigue el formato válido `http://www.example.com` , la respuesta JSON contendrá `{ error: 'invalid url' }`
```js ```js
async (getUserInput) => { async (getUserInput) => {

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb3367417b2b2512bfc id: 587d7fb3367417b2b2512bfc
title: Add a Description to Your package.json title: Agrega una descripción a tu package.json
challengeType: 2 challengeType: 2
forumTopicId: 301522 forumTopicId: 301522
dashedName: add-a-description-to-your-package-json dashedName: add-a-description-to-your-package-json
@ -8,11 +8,11 @@ dashedName: add-a-description-to-your-package-json
# --description-- # --description--
The next part of a good package.json file is the `description` field; where a short, but informative description about your project belongs. La siguiente parte de un buen archivo package.json es el campo `description`; donde pertenece una descripción corta, pero informativa de tu proyecto.
If you some day plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. However, thats not the only use case for the description, its a great way to summarize what a project does. Its just as important in any Node.js project to help other developers, future maintainers or even your future self understand the project quickly. Si algún día planeas publicar un paquete a npm, esta es la cadena que debería vender su idea al usuario cuando decida si instalar o no el paquete. Sin embargo, ese no es el único caso de uso para la descripción, es una buena manera de resumir lo que hace un proyecto. Es igual de importante en cualquier proyecto Node.js para ayudar a otros desarrolladores, futuros mantenedores o incluso a tu yo del futuro a entender el proyecto rápidamente.
Regardless of what you plan for your project, a description is definitely recommended. Here's an example: Independientemente de lo que planees para tu proyecto, definitivamente se recomienda una descripción. He aquí un ejemplo:
```json ```json
"description": "A project that does something awesome", "description": "A project that does something awesome",
@ -20,13 +20,13 @@ Regardless of what you plan for your project, a description is definitely recomm
# --instructions-- # --instructions--
Add a `description` to the package.json file of your project. Añade una `description` al archivo package.json de tu proyecto.
**Note:** Remember to use double-quotes for field-names (") and commas (,) to separate fields. **Nota:** Recuerda usar comillas dobles para nombres de campos (") y comas (,) para separar campos.
# --hints-- # --hints--
package.json should have a valid "description" key el archivo package.json debe tener una clave de "description" válida
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb4367417b2b2512bfe id: 587d7fb4367417b2b2512bfe
title: Add a License to Your package.json title: Agrega una licencia a tu package.json
challengeType: 2 challengeType: 2
forumTopicId: 301523 forumTopicId: 301523
dashedName: add-a-license-to-your-package-json dashedName: add-a-license-to-your-package-json
@ -8,9 +8,9 @@ dashedName: add-a-license-to-your-package-json
# --description-- # --description--
The `license` field is where you inform users of what they are allowed to do with your project. El campo `license` es donde se informa a los usuarios de lo que pueden hacer con tu proyecto.
Some common licenses for open source projects include MIT and BSD. License information is not required, and copyright laws in most countries will give you ownership of what you create by default. However, its always a good practice to explicitly state what users can and cant do. Here's an example of the license field: Algunas de las licencias comunes para proyectos de código abierto incluyen MIT y BSD. La información de la licencia no es requerida, y las leyes de derechos de autor en la mayoría de los países te darán la propiedad de lo que creas de manera predeterminada. Sin embargo, siempre es una buena práctica exponer explícitamente lo que los usuarios pueden y no pueden hacer. Aquí hay un ejemplo del campo de la licencia:
```json ```json
"license": "MIT", "license": "MIT",
@ -18,11 +18,11 @@ Some common licenses for open source projects include MIT and BSD. License infor
# --instructions-- # --instructions--
Fill the `license` field in the package.json file of your project as you find suitable. Rellena el campo `license` en el archivo package.json de tu proyecto según lo encuentres apropiado.
# --hints-- # --hints--
package.json should have a valid "license" key package.json debe tener una clave válida de "license"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb4367417b2b2512bff id: 587d7fb4367417b2b2512bff
title: Add a Version to Your package.json title: Añade una versión a tu package.json
challengeType: 2 challengeType: 2
forumTopicId: 301525 forumTopicId: 301525
dashedName: add-a-version-to-your-package-json dashedName: add-a-version-to-your-package-json
@ -8,7 +8,7 @@ dashedName: add-a-version-to-your-package-json
# --description-- # --description--
A `version` is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example: Una `version` es uno de los campos obligatorios de tu archivo package.json. Este campo describe la versión actual de tu proyecto. A continuación un ejemplo:
```json ```json
"version": "1.2.0", "version": "1.2.0",
@ -16,11 +16,11 @@ A `version` is one of the required fields of your package.json file. This field
# --instructions-- # --instructions--
Add a `version` to the package.json file of your project. Añade una `version` al archivo package.json de tu proyecto.
# --hints-- # --hints--
package.json should have a valid "version" key package.json debe tener una clave de "version" válida
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb4367417b2b2512bfd id: 587d7fb4367417b2b2512bfd
title: Add Keywords to Your package.json title: Añade palabras clave a tu package.json
challengeType: 2 challengeType: 2
forumTopicId: 301526 forumTopicId: 301526
dashedName: add-keywords-to-your-package-json dashedName: add-keywords-to-your-package-json
@ -8,23 +8,23 @@ dashedName: add-keywords-to-your-package-json
# --description-- # --description--
The `keywords` field is where you can describe your project using related keywords. Here's an example: El campo `keywords` es donde puedes describir tu proyecto usando palabras clave relacionadas. A continuación un ejemplo:
```json ```json
"keywords": [ "descriptive", "related", "words" ], "keywords": [ "descriptive", "related", "words" ],
``` ```
As you can see, this field is structured as an array of double-quoted strings. Como puedes ver, este campo está estructurado como un arreglo de cadenas con comillas dobles.
# --instructions-- # --instructions--
Add an array of suitable strings to the `keywords` field in the package.json file of your project. Añade un arreglo de cadenas adecuadas al campo `keywords` en el archivo package.json de tu proyecto.
One of the keywords should be "freecodecamp". Una de las palabras clave debe ser "freecodecamp".
# --hints-- # --hints--
package.json should have a valid "keywords" key el archivo package.json debe tener una clave "keywords" válida
```js ```js
(getUserInput) => (getUserInput) =>
@ -39,7 +39,7 @@ package.json should have a valid "keywords" key
); );
``` ```
"keywords" field should be an Array El campo "keywords" debe ser un arreglo
```js ```js
(getUserInput) => (getUserInput) =>
@ -54,7 +54,7 @@ package.json should have a valid "keywords" key
); );
``` ```
"keywords" should include "freecodecamp" "keywords" debe incluir "freecodecamp"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb4367417b2b2512c00 id: 587d7fb4367417b2b2512c00
title: Expand Your Project with External Packages from npm title: Ampliar tu proyecto con paquetes externos de npm
challengeType: 2 challengeType: 2
forumTopicId: 301527 forumTopicId: 301527
dashedName: expand-your-project-with-external-packages-from-npm dashedName: expand-your-project-with-external-packages-from-npm
@ -8,9 +8,9 @@ dashedName: expand-your-project-with-external-packages-from-npm
# --description-- # --description--
One of the biggest reasons to use a package manager, is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the `dependencies` section of your package.json file. Una de las razones más importantes para utilizar un gestor de paquetes, es su potente gestión de dependencias. En lugar de tener que asegurarte manualmente de que obtienes todas las dependencias cada vez que configuras un proyecto en una nuevo computadora, npm instala automáticamente todo para ti. Pero ¿cómo puede npm saber exactamente lo que necesita tu proyecto? Conoce la sección `dependencies` de tu archivo package.json.
In this section, packages your project requires are stored using the following format: En esta sección, los paquetes que tu proyecto necesita se almacenan usando el siguiente formato:
```json ```json
"dependencies": { "dependencies": {
@ -22,13 +22,13 @@ In this section, packages your project requires are stored using the following f
# --instructions-- # --instructions--
Add version "2.14.0" of the "moment" package to the `dependencies` field of your package.json file. Añade la versión "2.14.0" del paquete "moment" al campo `dependencies` del archivo package.json.
**Note:** Moment is a handy library for working with time and dates. **Nota:** Moment es una biblioteca muy útil para trabajar con tiempo y fechas.
# --hints-- # --hints--
"dependencies" should include "moment" "dependencies" debe incluir "moment"
```js ```js
(getUserInput) => (getUserInput) =>
@ -47,7 +47,7 @@ Add version "2.14.0" of the "moment" package to the `dependencies` field of your
); );
``` ```
"moment" version should be "2.14.0" la versión de "moment" debe ser "2.14.0"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb3367417b2b2512bfb id: 587d7fb3367417b2b2512bfb
title: 'How to Use package.json, the Core of Any Node.js Project or npm Package' title: 'Cómo usar package.json, el núcleo de cualquier proyecto Node.js o paquete npm'
challengeType: 2 challengeType: 2
forumTopicId: 301528 forumTopicId: 301528
dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package
@ -8,19 +8,19 @@ dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-packa
# --description-- # --description--
Working on these challenges will involve you writing your code using one of the following methods: Trabajar en estos desafíos implica escribir tu código usando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-npm/) and complete these challenges locally. - Clona [este repositorio de Github](https://github.com/freeCodeCamp/boilerplate-npm/) y completa estos desafíos localmente.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-npm) to complete these challenges. - Usa [nuestro proyecto modelo de Replit](https://replit.com/github/freeCodeCamp/boilerplate-npm) para completar estos retos.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Utiliza un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the &lt;head> section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; "name" and "version", but its good practice to provide additional information about your project that could be useful to future users or maintainers. El archivo `package.json` es el centro de cualquier proyecto Node.js o paquete npm. Almacena información sobre tu proyecto, similar a cómo la sección &lt;head> de un documento HTML describe el contenido de una página web. Consiste en un único objeto JSON donde la información se almacena en pares clave-valor. Sólo hay dos campos obligatorios; "name" y "version", pero es una buena práctica proporcionar información adicional sobre tu proyecto que podría ser útil para futuros usuarios o mantenedores.
If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. Si miras el árbol de archivos de tu proyecto, encontrarás el archivo package.json en el nivel superior del árbol. Este es el archivo que mejorarás en el próximo par de desafíos.
One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project. Una de las piezas de información más comunes en este archivo es el campo `author`. Este especifica quién creó el proyecto, y puede consistir en una cadena u objeto con contacto u otros detalles. Se recomienda un objeto para proyectos más grandes, pero una simple cadena como el siguiente ejemplo funcionará para este proyecto.
```json ```json
"author": "Jane Doe", "author": "Jane Doe",
@ -28,13 +28,13 @@ One of the most common pieces of information in this file is the `author` field.
# --instructions-- # --instructions--
Add your name as the `author` of the project in the package.json file. Añade tu nombre como el `author` del proyecto en el archivo package.json.
**Note:** Remember that youre writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). **Nota:** Recuerda que estás escribiendo JSON, por lo que todos los nombres de campos deben usar comillas dobles (") y separarse con una coma (,).
# --hints-- # --hints--
package.json should have a valid "author" key el archivo package.json debe tener una clave "author" válida
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb5367417b2b2512c01 id: 587d7fb5367417b2b2512c01
title: Manage npm Dependencies By Understanding Semantic Versioning title: Gestiona dependencias npm entendiendo versionado semántico
challengeType: 2 challengeType: 2
forumTopicId: 301529 forumTopicId: 301529
dashedName: manage-npm-dependencies-by-understanding-semantic-versioning dashedName: manage-npm-dependencies-by-understanding-semantic-versioning
@ -8,23 +8,23 @@ dashedName: manage-npm-dependencies-by-understanding-semantic-versioning
# --description-- # --description--
`Versions` of the npm packages in the dependencies section of your package.json file follow whats called Semantic Versioning (SemVer), an industry standard for software versioning aiming to make it easier to manage dependencies. Libraries, frameworks or other tools published on npm should use SemVer in order to clearly communicate what kind of changes projects can expect if they update. `Versions` de los paquetes npm en la sección dependencias de tu archivo package.json siguen lo que se llama Versionado Semántico (SemVer), un estándar de la industria para el versionado de software con el objetivo de facilitar la gestión de las dependencias. Bibliotecas, frameworks u otras herramientas publicadas en npm deberían usar SemVer para comunicar claramente qué tipo de cambios pueden esperar los proyectos si se actualizan.
Knowing SemVer can be useful when you develop software that uses external dependencies (which you almost always do). One day, your understanding of these numbers will save you from accidentally introducing breaking changes to your project without understanding why things that worked yesterday suddenly dont work today. This is how Semantic Versioning works according to the official website: Conocer SemVer puede ser útil cuando se desarrolla software que utiliza dependencias externas (algo que casi siempre se hace). Un día tu comprensión de estos números te salvará de introducir accidentalmente cambios que rompan tu proyecto, sin entender por qué las cosas que funcionaron ayer de repente no funcionan hoy. Así es como funciona el Versionado Semántico según el sitio web oficial:
```json ```json
"package": "MAJOR.MINOR.PATCH" "package": "MAJOR.MINOR.PATCH"
``` ```
The MAJOR version should increment when you make incompatible API changes. The MINOR version should increment when you add functionality in a backwards-compatible manner. The PATCH version should increment when you make backwards-compatible bug fixes. This means that PATCHes are bug fixes and MINORs add new features but neither of them break what worked before. Finally, MAJORs add changes that wont work with earlier versions. La versión MAJOR debe incrementarse cuando hagas cambios de API incompatibles. La versión MINOR debe incrementarse cuando añadas funcionalidades de forma compatible con versiones anteriores. La versión de PATCH debe incrementarse cuando realices correcciones de errores compatibles con versiones anteriores. Esto significa que PATCHes son correcciones de errores y los MINORs añaden nuevas funcionalidades, pero ninguno de ellos rompe lo que funcionó antes. Finalmente, los MAJORs añaden cambios que no funcionarán con versiones anteriores.
# --instructions-- # --instructions--
In the dependencies section of your package.json file, change the `version` of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2 En la sección de dependencias de tu archivo package.json, cambia la `version` de moment para que coincida con la versión 2 de MAJOR, la versión 10 de MINOR y la versión 2 de PATCH
# --hints-- # --hints--
"dependencies" should include "moment" "dependencies" debe incluir "moment"
```js ```js
(getUserInput) => (getUserInput) =>
@ -43,7 +43,7 @@ In the dependencies section of your package.json file, change the `version` of m
); );
``` ```
"moment" version should be "2.10.2" la versión de "moment" debe ser "2.10.2"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb5367417b2b2512c04 id: 587d7fb5367417b2b2512c04
title: Remove a Package from Your Dependencies title: Elimina un paquete de tus dependencias
challengeType: 2 challengeType: 2
forumTopicId: 301530 forumTopicId: 301530
dashedName: remove-a-package-from-your-dependencies dashedName: remove-a-package-from-your-dependencies
@ -8,21 +8,21 @@ dashedName: remove-a-package-from-your-dependencies
# --description-- # --description--
You have now tested a few ways you can manage dependencies of your project by using the package.json's dependencies section. You have also included external packages by adding them to the file and even told npm what types of versions you want, by using special characters such as the tilde or the caret. Ahora has probado algunas maneras en que puedes gestionar las dependencias de tu proyecto usando la sección de dependencias de package.json. También has incluido paquetes externos agregándolos al archivo e incluso le has dicho a npm los tipos de versiones que deseas, usando caracteres especiales como la tilde o el caret.
But what if you want to remove an external package that you no longer need? You might already have guessed it, just remove the corresponding key-value pair for that package from your dependencies. Pero, ¿Qué pasa si deseas eliminar un paquete externo que ya no necesitas? Puede que ya lo hayas adivinado, simplemente elimina el par clave-valor correspondiente a ese paquete de tus dependencias.
This same method applies to removing other fields in your package.json as well Este mismo método se aplica para eliminar otros campos de tu package.json
# --instructions-- # --instructions--
Remove the moment package from your dependencies. Elimina el paquete moment de tus dependencias.
**Note:** Make sure you have the right amount of commas after removing it. **Nota:** Asegúrate de que tienes la cantidad correcta de comas después de eliminarlo.
# --hints-- # --hints--
"dependencies" should not include "moment" Las "dependencies" no deben incluir "moment"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fb5367417b2b2512c03 id: 587d7fb5367417b2b2512c03
title: Use the Caret-Character to Use the Latest Minor Version of a Dependency title: Usa el carácter caret para usar la última versión menor de una dependencia
challengeType: 2 challengeType: 2
forumTopicId: 301531 forumTopicId: 301531
dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency
@ -8,25 +8,25 @@ dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-depende
# --description-- # --description--
Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. Similar a cómo la tilde que aprendimos en el último desafío permite a npm instalar la última PATCH para una dependencia, el caret (`^`) permite a npm instalar futuras actualizaciones también. La diferencia es que el caret permitirá tanto actualizaciones MINOR como PATCHes.
Your current version of moment should be "~2.10.2" which allows npm to install to the latest 2.10.x version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any 2.x.x version. Tu versión actual de moment debe ser "~2.10.0" lo que permite a npm instalar la última versión 2.10.x. Si se usara el caret (^) como prefijo de versión en su lugar, npm permitiría actualizar a cualquier versión 2.x.x.
```json ```json
"package": "^1.3.8" "package": "^1.3.8"
``` ```
This would allow updates to any 1.x.x version of the package. Esto permitiría actualizaciones a cualquier version 1.x.x del paquete.
# --instructions-- # --instructions--
Use the caret (`^`) to prefix the version of moment in your dependencies and allow npm to update it to any new MINOR release. Usa el caret (`^`) para anteponer la versión de moment en tus dependencias y permitir a npm actualizarlo a cualquier nueva versión MINOR.
**Note:** The version numbers themselves should not be changed. **Nota:** Los números de versión no deben ser cambiados.
# --hints-- # --hints--
"dependencies" should include "moment" "dependencies" debe incluir "moment"
```js ```js
(getUserInput) => (getUserInput) =>
@ -45,7 +45,7 @@ Use the caret (`^`) to prefix the version of moment in your dependencies and all
); );
``` ```
"moment" version should match "^2.x.x" la versión de "moment" debe coincidir con "2.x.x"
```js ```js
(getUserInput) => (getUserInput) =>

View File

@ -27,6 +27,8 @@ Quando terminar, certifique-se de que uma demonstração funcional do seu projet
3. Você adicionará todas as funcionalidades de segurança ao `server.js` 3. Você adicionará todas as funcionalidades de segurança ao `server.js`
4. Você criará todos os testes funcionais em `tests/2_functional-tests.js` 4. Você criará todos os testes funcionais em `tests/2_functional-tests.js`
**Observação** Considerações de privacidade: devido à exigência de que apenas uma curtida por IP deve ser aceita, você terá que salvar endereços IP. É importante manter a conformidade com as leis relativas à privacidade de dados, como o Regulamento Geral para a Proteção de Dados. Uma opção é obter permissão para salvar os dados do usuário, mas é muito mais simples deixar os dados anônimos. Para este desafio, lembre-se de anonimizar endereços IP antes de salvá-los no banco de dados. Se você precisa de ideias sobre como fazer isso, você pode optar por criptografar os dados (algoritmo hash), omitir parte deles, ou definir parte do endereço IP como 0.
Escreva os testes a seguir em `tests/2_functional-tests.js`: Escreva os testes a seguir em `tests/2_functional-tests.js`:
- Visualizar uma ação: faça a solicitação de GET para `/api/stock-prices/` - Visualizar uma ação: faça a solicitação de GET para `/api/stock-prices/`
@ -62,7 +64,7 @@ async (getUserInput) => {
}; };
``` ```
Você pode enviar uma solicitação de `GET` para `/api/stock-prices`, passando um símbolo da ação na NASDAQ para um parâmetro de consulta de `stock`. O objeto retornado conterá uma propriedade chamada `stockData`. Você pode enviar uma requisição do tipo `GET` para `/api/stock-prices`, passando um símbolo de ação NASDAQ para um parâmetro de consulta `stock`. O objeto retornado conterá uma propriedade chamada `stockData`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -74,7 +76,7 @@ async (getUserInput) => {
}; };
``` ```
A propriedade `stockData` inclui o símbolo de `stock` como uma string, o `price` como um número e `likes` como um número. A propriedade `stockData` inclui o símbolo da ação `stock` como uma string, o preço `price` como um número e o número de curtidas `likes` como um número.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -89,13 +91,13 @@ async (getUserInput) => {
}; };
``` ```
Você também pode passar adiante um campo `like` como `true` (booleano) para ter sua curtida adicionada ao(s) estoque(s). Apenas 1 curtida por IP deve ser aceita. Você também pode passar um campo `like` como `true` (booleano) para ter sua curtida adicionada à ação. Apenas 1 curtida por IP deve ser aceita.
```js ```js
``` ```
Se você passar 2 ações, o valor retornado será um array com informações sobre as duas. Em vez de `likes`, será exibido `rel_likes` (a diferença entre curtidas entre ambas as ações) para os dois objetos de `stockData`. Se você passar 2 ações, o valor retornado será um array com informações sobre as duas. Em vez do número de curtidas `likes`, será exibida a propriedade `rel_likes` (a diferença de curtidas entre ambas as ações) para os dois objetos `stockData`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -110,7 +112,7 @@ async (getUserInput) => {
}; };
``` ```
Todos os 5 testes funcionais foram concluídos e deram aprovação. Todos os 5 testes funcionais estão completos e passando.
```js ```js
async (getUserInput) => { async (getUserInput) => {